Loading src/UnicaenAuth/Entity/Db/AbstractUser.php +6 −5 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace UnicaenAuth\Entity\Db; use BjyAuthorize\Provider\Role\ProviderInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use ZfcUser\Entity\UserInterface; Loading Loading @@ -53,7 +54,7 @@ abstract class AbstractUser implements UserInterface, ProviderInterface protected $state; /** * @var \Doctrine\Common\Collections\Collection * @var Collection * @ORM\ManyToMany(targetEntity="UnicaenAuth\Entity\Db\Role") * @ORM\JoinTable(name="user_role_linker", * joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, Loading Loading @@ -205,11 +206,11 @@ abstract class AbstractUser implements UserInterface, ProviderInterface /** * Get role. * * @return array * @return Collection */ public function getRoles() { return $this->roles->getValues(); return $this->roles; } /** Loading @@ -219,9 +220,9 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * * @return void */ public function addRole($role) public function addRole(Role $role) { $this->roles[] = $role; $this->roles->add($role); } /** Loading Loading
src/UnicaenAuth/Entity/Db/AbstractUser.php +6 −5 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace UnicaenAuth\Entity\Db; use BjyAuthorize\Provider\Role\ProviderInterface; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use ZfcUser\Entity\UserInterface; Loading Loading @@ -53,7 +54,7 @@ abstract class AbstractUser implements UserInterface, ProviderInterface protected $state; /** * @var \Doctrine\Common\Collections\Collection * @var Collection * @ORM\ManyToMany(targetEntity="UnicaenAuth\Entity\Db\Role") * @ORM\JoinTable(name="user_role_linker", * joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, Loading Loading @@ -205,11 +206,11 @@ abstract class AbstractUser implements UserInterface, ProviderInterface /** * Get role. * * @return array * @return Collection */ public function getRoles() { return $this->roles->getValues(); return $this->roles; } /** Loading @@ -219,9 +220,9 @@ abstract class AbstractUser implements UserInterface, ProviderInterface * * @return void */ public function addRole($role) public function addRole(Role $role) { $this->roles[] = $role; $this->roles->add($role); } /** Loading