dons = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @return Collection */ public function getDons(): Collection { return $this->dons; } public function addDon(Don $don): self { if (!$this->dons->contains($don)) { $this->dons->add($don); $don->setDonCat($this); } return $this; } public function removeDon(Don $don): self { if ($this->dons->removeElement($don)) { // set the owning side to null (unless already changed) if ($don->getDonCat() === $this) { $don->setDonCat(null); } } return $this; } public function __toString() { return $this->name; } }