<?php
namespace App\Entity;
use App\Entity\Translation\BannerTranslation;
use App\Repository\BannerRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Translation\BlockTranslation;
use Gedmo\Mapping\Annotation\TranslationEntity;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
#[ORM\Entity(repositoryClass: BannerRepository::class)]
#[TranslationEntity(class: BannerTranslation::class)]
class Banner implements EntityInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $page = null;
#[ORM\Column]
private ?int $position = null;
#[ORM\Column(length: 255)]
#[GedmoTranslatable]
private ?string $href = null;
#[ORM\Column(type: Types::TEXT)]
#[GedmoTranslatable]
private ?string $cont = null;
#[ORM\Column]
private ?bool $visible = null;
#[ORM\Column(type: Types::SMALLINT)]
private ?int $prior = null;
#[GedmoLocale]
private $locale;
#[ORM\OneToMany(targetEntity: BlockTranslation::class, mappedBy: 'object', cascade: ['persist', 'remove'])]
private $translations;
public function __construct()
{
$this->translations = new ArrayCollection();
}
public function setLocale($locale)
{
$this->locale = $locale;
}
public function getTranslations()
{
return $this->translations;
}
public function addTranslation(BlockTranslation $t)
{
if (!$this->translations->contains($t)) {
$this->translations[] = $t;
$t->setObject($this);
}
}
public function getId(): ?int
{
return $this->id;
}
public function getPage(): ?string
{
return $this->page;
}
public function setPage(string $page): self
{
$this->page = $page;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setPosition(int $position): self
{
$this->position = $position;
return $this;
}
public function getHref(): ?string
{
return $this->href;
}
public function setHref(string $href): self
{
$this->href = $href;
return $this;
}
public function getCont(): ?string
{
return $this->cont;
}
public function setCont(string $cont): self
{
$this->cont = $cont;
return $this;
}
public function isVisible(): ?bool
{
return $this->visible;
}
public function setVisible(bool $visible): self
{
$this->visible = $visible;
return $this;
}
public function getPrior(): ?int
{
return $this->prior;
}
public function setPrior(int $prior): self
{
$this->prior = $prior;
return $this;
}
}