users = new ArrayCollection(); $this->unit = 'amount'; } public function __toString() { return $this->title; } public function getTitle(): ?string { return $this->title; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getMerchant(): ?Merchant { return $this->merchant; } public function setMerchant(?Merchant $merchant): self { $this->merchant = $merchant; return $this; } /** * @return Collection|User[] */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users[] = $user; } return $this; } public function removeUser(User $user): self { if ($this->users->contains($user)) { $this->users->removeElement($user); } return $this; } }