src/Entity/Menu.php line 13
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\MenuRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: MenuRepository::class)]#[ApiResource]class Menu{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 70)]private ?string $menuName = null;#[ORM\Column(length: 255)]private ?string $menuLink = null;#[ORM\ManyToOne(inversedBy: 'menus')]#[ORM\JoinColumn(nullable: false)]private ?MenuType $menuType = null;#[ORM\OneToMany(mappedBy: 'menu', targetEntity: ProfileMenu::class, orphanRemoval: true)]private Collection $profileMenus;public function __construct(){$this->profileMenus = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getMenuName(): ?string{return $this->menuName;}public function setMenuName(string $menuName): self{$this->menuName = $menuName;return $this;}public function getMenuLink(): ?string{return $this->menuLink;}public function setMenuLink(string $menuLink): self{$this->menuLink = $menuLink;return $this;}public function getMenuType(): ?MenuType{return $this->menuType;}public function setMenuType(?MenuType $menuType): self{$this->menuType = $menuType;return $this;}/*** @return Collection<int, ProfileMenu>*/public function getProfileMenus(): Collection{return $this->profileMenus;}public function addProfileMenu(ProfileMenu $profileMenu): self{if (!$this->profileMenus->contains($profileMenu)) {$this->profileMenus->add($profileMenu);$profileMenu->setMenu($this);}return $this;}public function removeProfileMenu(ProfileMenu $profileMenu): self{if ($this->profileMenus->removeElement($profileMenu)) {// set the owning side to null (unless already changed)if ($profileMenu->getMenu() === $this) {$profileMenu->setMenu(null);}}return $this;}}