src/Entity/ChildMenu.php line 16

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\MainTranslationTrait;
  4. use App\Entity\Translation\ChildMenuTranslation;
  5. use App\Repository\ChildMenuRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Translatable\Translatable;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. #[ORM\Table(name'child_menu')]
  10. #[ORM\Entity(repositoryClassChildMenuRepository::class)]
  11. #[Gedmo\TranslationEntity(class: ChildMenuTranslation::class)]
  12. class ChildMenu implements Translatable
  13. {
  14.     use MainTranslationTrait;
  15.     const TRANSLATION_ENTITY ChildMenuTranslation::class;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(type'string'nullabletrue)]
  21.     #[Gedmo\Translatable]
  22.     private ?string $title null;
  23.     #[ORM\Column(type'string',uniquetruenullabletrue)]
  24.     private ?string $url null;
  25.     #[ORM\Column(type'integer'nullabletrue)]
  26.     private ?int $position null;
  27.     #[ORM\ManyToOne(targetEntityMenu::class, inversedBy'childMenu')]
  28.     private ?Menu $menu null;
  29.     #[ORM\Column(type'boolean'nullabletrue)]
  30.     private ?bool $showInFooter null;
  31.     #[ORM\Column(type'boolean'nullabletrue)]
  32.     private ?bool $showInHeader null;
  33. //    #[ORM\OneToMany(mappedBy: 'object', targetEntity: ChildMenuTranslation::class, cascade: ['persist', 'remove'])]
  34. //    private $translations;
  35.     public function __toString(): string
  36.     {
  37.         return $this->title ?? "";
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getTitle(): ?string
  44.     {
  45.         return $this->title;
  46.     }
  47.     public function setTitle(?string $title): void
  48.     {
  49.         $this->title $title;
  50.     }
  51.     public function getUrl(): ?string
  52.     {
  53.         return $this->url;
  54.     }
  55.     public function setUrl(?string $url): void
  56.     {
  57.         $this->url $url;
  58.     }
  59.     public function getMenu(): ?Menu
  60.     {
  61.         return $this->menu;
  62.     }
  63.     public function setMenu(?Menu $menu): static
  64.     {
  65.         $this->menu $menu;
  66.         return $this;
  67.     }
  68.     public function getPosition(): ?int
  69.     {
  70.         return $this->position;
  71.     }
  72.     public function setPosition(?int $position): void
  73.     {
  74.         $this->position $position;
  75.     }
  76.     public function getShowInFooter(): ?bool
  77.     {
  78.         return $this->showInFooter;
  79.     }
  80.     public function setShowInFooter(?bool $showInFooter): void
  81.     {
  82.         $this->showInFooter $showInFooter;
  83.     }
  84.     public function getShowInHeader(): ?bool
  85.     {
  86.         return $this->showInHeader;
  87.     }
  88.     public function setShowInHeader(?bool $showInHeader): void
  89.     {
  90.         $this->showInHeader $showInHeader;
  91.     }
  92. }