users ?: $this->users = new ArrayCollection(); } public function addUser(User $user) { if (!$this->getUsers()->contains($user)) { $this->getUsers()->add($user); } return $this; } /** * {@inheritdoc} */ public function removeUser(User $user) { if ($this->getUsers()->contains($user)) { $this->getUsers()->removeElement($user); } return $this; } public function __toString() { return $this->getName(); } }