Commit 3b637874 authored by Anthony Gautreau's avatar Anthony Gautreau
Browse files

Fix liste de roles non instancié

parent e9dcdd3e
Loading
Loading
Loading
Loading
+5 −0
Changes for api/src/Entity/AbstractUser.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ abstract class AbstractUser implements UserInterface, PasswordAuthenticatedUserI
    #[ORM\OneToMany(targetEntity: UserRoleInterface::class, orphanRemoval: true, mappedBy: 'user', cascade: ['persist', 'remove'])]
    protected Collection $roles;

    public function __construct()
    {
        $this->roles = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;