*/ #[ORM\ManyToMany(targetEntity: plat::class, inversedBy: 'menus')] private Collection $plats; #[ORM\ManyToOne(inversedBy: 'menus')] private ?Restaurant $restaurant = null; public function __construct() { $this->plats = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNom(): ?string { return $this->nom; } public function setNom(string $nom): static { $this->nom = $nom; return $this; } public function getDateDeCreation(): ?\DateTimeImmutable { return $this->dateDeCreation; } public function setDateDeCreation(\DateTimeImmutable $dateDeCreation): static { $this->dateDeCreation = $dateDeCreation; return $this; } /** * @return Collection */ public function getPlats(): Collection { return $this->plats; } public function addPlat(plat $plat): static { if (!$this->plats->contains($plat)) { $this->plats->add($plat); } return $this; } public function removePlat(plat $plat): static { $this->plats->removeElement($plat); return $this; } public function getRestaurant(): ?Restaurant { return $this->restaurant; } public function setRestaurant(?Restaurant $restaurant): static { $this->restaurant = $restaurant; return $this; } }