*/ #[ORM\ManyToMany(targetEntity: Restaurants::class, mappedBy: 'kitchens_id')] private Collection $restaurants_id; public function __construct() { $this->restaurants_id = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } /** * @return Collection */ public function getRestaurantsId(): Collection { return $this->restaurants_id; } public function addRestaurantsId(Restaurants $restaurantsId): static { if (!$this->restaurants_id->contains($restaurantsId)) { $this->restaurants_id->add($restaurantsId); $restaurantsId->addKitchensId($this); } return $this; } public function removeRestaurantsId(Restaurants $restaurantsId): static { if ($this->restaurants_id->removeElement($restaurantsId)) { $restaurantsId->removeKitchensId($this); } return $this; } }