bills = new ArrayCollection(); } public function __toString() { return (string) $this->getLabel(); } public function getId(): ?int { return $this->id; } public function getLabel(): ?string { return $this->label; } public function setLabel(string $label): self { $this->label = $label; return $this; } /** * @return Collection */ public function getBills(): Collection { return $this->bills; } public function addBill(Bill $bill): self { if (!$this->bills->contains($bill)) { $this->bills->add($bill); $bill->setCategory($this); } return $this; } public function removeBill(Bill $bill): self { if ($this->bills->removeElement($bill)) { // set the owning side to null (unless already changed) if ($bill->getCategory() === $this) { $bill->setCategory(null); } } return $this; } }