id = new Ulid; $this->menuItems = new ArrayCollection; } public function getId(): Ulid { return $this->id; } public function getName(): string|null { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } /** * @return Collection */ public function getMenuItems(): Collection { return $this->menuItems; } public function addMenuItem(MenuItem $menuItem): static { if (! $this->menuItems->contains($menuItem)) { $this->menuItems->add($menuItem); $menuItem->setVendor($this); } return $this; } public function removeMenuItem(MenuItem $menuItem): static { // set the owning side to null (unless already changed) if ( $this->menuItems->removeElement($menuItem) && $menuItem->getVendor() === $this ) { $menuItem->setVendor(null); } return $this; } }