diff --git a/src/UnicaenAuth/Entity/Db/AbstractRole.php b/src/UnicaenAuth/Entity/Db/AbstractRole.php index aaa2e6cb05f9ca59c221ecd7cde903bda9e34250..ba211994ecc4210d236d3ec7be70ab67d2d1315b 100644 --- a/src/UnicaenAuth/Entity/Db/AbstractRole.php +++ b/src/UnicaenAuth/Entity/Db/AbstractRole.php @@ -2,6 +2,7 @@ namespace UnicaenAuth\Entity\Db; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; /** @@ -53,6 +54,14 @@ abstract class AbstractRole implements RoleInterface */ protected $users; + /** + * AbstractRole constructor. + */ + public function __construct() + { + $this->users = new ArrayCollection(); + } + /** * Get the id. * @@ -191,6 +200,14 @@ abstract class AbstractRole implements RoleInterface $this->users[] = $user; } + /** + * @param UserInterface $user + */ + public function removeUser(UserInterface $user) + { + $this->users->removeElement($user); + } + /** * * @return string