*/ #[ORM\ManyToMany(targetEntity: User::class, mappedBy: 'userGroups')] private Collection $users; public function __construct() { parent::__construct(); $this->users = new ArrayCollection(); } public function getPermissions(): array { return $this->permissions; } public function setPermissions(array $permissions): static { $this->permissions = $permissions; return $this; } /** * @return Collection */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): static { if (!$this->users->contains($user)) { $this->users->add($user); } return $this; } public function removeUser(User $user): static { $this->users->removeElement($user); return $this; } }