id = $id; return $this; } public function __construct() { $this->menuchilds = 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 getMenuchilds(): Collection { return $this->menuchilds; } public function addMenuchild(Menuchild $menuchild): self { if (!$this->menuchilds->contains($menuchild)) { $this->menuchilds->add($menuchild); $menuchild->setMenu($this); } return $this; } public function removeMenuchild(Menuchild $menuchild): self { if ($this->menuchilds->removeElement($menuchild)) { // set the owning side to null (unless already changed) if ($menuchild->getMenu() === $this) { $menuchild->setMenu(null); } } return $this; } }