<?php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
use App\Repository\BannerTranslationRepository;
#[ORM\Entity(repositoryClass: BannerTranslationRepository::class)]
class BannerTranslation implements TranslationInterface
{
use TranslationTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Assert\NotNull()]
private ?string $title = null;
#[ORM\Column(length: 255, nullable: true)]
#[Assert\Length(max: 255)]
private ?string $description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $button_text = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $link = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[Assert\NotNull()]
private ?Media $image = null;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getButtonText(): ?string
{
return $this->button_text;
}
public function setButtonText(?string $button_text): self
{
$this->button_text = $button_text;
return $this;
}
public function getLink(): ?string
{
return $this->link;
}
public function setLink(?string $link): self
{
$this->link = $link;
return $this;
}
public function getImage(): ?Media
{
return $this->image;
}
public function setImage(Media $image): self
{
$image->setDirectory('banner');
$this->image = $image;
return $this;
}
}