<?phpnamespace App\Entity;use App\Repository\RouteRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: RouteRepository::class)]class Route implements \Stringable{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $name; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $menu_id; #[ORM\Column(type: 'string', length: 255, nullable: true)] private $menu_name; #[ORM\ManyToMany(targetEntity: Droit::class, mappedBy: 'routes')] private $droits; public function __construct() { $this->droits = 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; } public function getMenuId(): ?string { return $this->menu_id; } public function setMenuId(string $menu_id): self { $this->menu_id = $menu_id; return $this; } public function getMenuName(): ?string { return $this->menu_name; } public function setMenuName(?string $menu_name): self { $this->menu_name = $menu_name; return $this; } /** * @return Collection|Droit[] */ public function getDroits(): Collection { return $this->droits; } public function addDroit(Droit $droit): self { if (!$this->droits->contains($droit)) { $this->droits[] = $droit; $droit->addRoute($this); } return $this; } public function removeDroit(Droit $droit): self { if ($this->droits->removeElement($droit)) { $droit->removeRoute($this); } return $this; } public function __toString(): string { return (string) $this->name; }}