* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Rapsys\TreeBundle\Entity; use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\ArrayCollection; use Rapsys\UserBundle\Entity\User as BaseUser; /** * {@inheritdoc} */ class User extends BaseUser { /** * @var \Doctrine\Common\Collections\Collection */ private Collection $elements; /** * Constructor * * @param string $mail The user mail * @param string $password The user password * @param ?Civility $civility The user civility * @param ?string $forename The user forename * @param ?string $surname The user surname * @param bool $active The user is active * @param bool $enable The user is enable * @param ?string $pseudonym The user pseudonym * @param ?string $slug The user slug */ 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) { //Call parent constructor parent::__construct($mail, $password, $civility, $forename, $surname, $active, $enable); //Set defaults //Set collections $this->elements = new ArrayCollection(); } /** * Add element * * @param Element $element * * @return User */ public function addElement(Element $element): User { $this->elements[] = $element; return $this; } /** * Remove element * * @param Element $element * * @return \Doctrine\Common\Collections\Collection */ public function removeElement(Element $element): Collection { return $this->elements->removeElement($element); } /** * Get elements * * @return \Doctrine\Common\Collections\Collection */ public function getElements(): Collection { return $this->elements; } }