1 <?php
declare(strict_types
=1);
4 * This file is part of the Rapsys TreeBundle package.
6 * (c) Raphaël Gertz <symfony@rapsys.eu>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Rapsys\TreeBundle\Entity
;
14 use Doctrine\Common\Collections\Collection
;
15 use Doctrine\Common\Collections\ArrayCollection
;
17 use Rapsys\UserBundle\Entity\User
as BaseUser
;
22 class User
extends BaseUser
{
24 * @var \Doctrine\Common\Collections\Collection
26 private Collection
$elements;
31 * @param string $mail The user mail
32 * @param string $password The user password
33 * @param ?Civility $civility The user civility
34 * @param ?string $forename The user forename
35 * @param ?string $surname The user surname
36 * @param bool $active The user is active
37 * @param bool $enable The user is enable
38 * @param ?string $pseudonym The user pseudonym
39 * @param ?string $slug The user slug
41 public function __construct(string $mail, string $password, ?Civility
$civility = null, ?string $forename = null, ?string $surname = null, bool $active = false, bool $enable = true, ?string $pseudonym = null, ?string $slug = null) {
42 //Call parent constructor
43 parent
::__construct($mail, $password, $civility, $forename, $surname, $active, $enable);
48 $this->elements
= new ArrayCollection();
54 * @param Element $element
58 public function addElement(Element
$element): User
{
59 $this->elements
[] = $element;
67 * @param Element $element
69 * @return \Doctrine\Common\Collections\Collection
71 public function removeElement(Element
$element): Collection
{
72 return $this->elements
->removeElement($element);
78 * @return \Doctrine\Common\Collections\Collection
80 public function getElements(): Collection
{
81 return $this->elements
;