src/Entity/Banner.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Translation\BannerTranslation;
  4. use App\Repository\BannerRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use App\Entity\Translation\BlockTranslation;
  8. use Gedmo\Mapping\Annotation\TranslationEntity;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
  11. use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
  12. #[ORM\Entity(repositoryClassBannerRepository::class)]
  13. #[TranslationEntity(class: BannerTranslation::class)]
  14. class Banner implements EntityInterface
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $page null;
  22.     #[ORM\Column]
  23.     private ?int $position null;
  24.     #[ORM\Column(length255)]
  25.     #[GedmoTranslatable]
  26.     private ?string $href null;
  27.     #[ORM\Column(typeTypes::TEXT)]
  28.     #[GedmoTranslatable]
  29.     private ?string $cont null;
  30.     #[ORM\Column]
  31.     private ?bool $visible null;
  32.     #[ORM\Column(typeTypes::SMALLINT)]
  33.     private ?int $prior null;
  34.     #[GedmoLocale]
  35.     private $locale;
  36.     #[ORM\OneToMany(targetEntityBlockTranslation::class, mappedBy'object'cascade: ['persist''remove'])]
  37.     private $translations;
  38.     public function __construct()
  39.     {
  40.         $this->translations = new ArrayCollection();
  41.     }
  42.     public function setLocale($locale)
  43.     {
  44.         $this->locale $locale;
  45.     }
  46.     public function getTranslations()
  47.     {
  48.         return $this->translations;
  49.     }
  50.     public function addTranslation(BlockTranslation $t)
  51.     {
  52.         if (!$this->translations->contains($t)) {
  53.             $this->translations[] = $t;
  54.             $t->setObject($this);
  55.         }
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getPage(): ?string
  62.     {
  63.         return $this->page;
  64.     }
  65.     public function setPage(string $page): self
  66.     {
  67.         $this->page $page;
  68.         return $this;
  69.     }
  70.     public function getPosition(): ?int
  71.     {
  72.         return $this->position;
  73.     }
  74.     public function setPosition(int $position): self
  75.     {
  76.         $this->position $position;
  77.         return $this;
  78.     }
  79.     public function getHref(): ?string
  80.     {
  81.         return $this->href;
  82.     }
  83.     public function setHref(string $href): self
  84.     {
  85.         $this->href $href;
  86.         return $this;
  87.     }
  88.     public function getCont(): ?string
  89.     {
  90.         return $this->cont;
  91.     }
  92.     public function setCont(string $cont): self
  93.     {
  94.         $this->cont $cont;
  95.         return $this;
  96.     }
  97.     public function isVisible(): ?bool
  98.     {
  99.         return $this->visible;
  100.     }
  101.     public function setVisible(bool $visible): self
  102.     {
  103.         $this->visible $visible;
  104.         return $this;
  105.     }
  106.     public function getPrior(): ?int
  107.     {
  108.         return $this->prior;
  109.     }
  110.     public function setPrior(int $prior): self
  111.     {
  112.         $this->prior $prior;
  113.         return $this;
  114.     }
  115. }