<?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\SlideTranslationRepository;
#[ORM\Entity(repositoryClass: SlideTranslationRepository::class)]
class SlideTranslation implements TranslationInterface
{
use TranslationTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $title = null;
#[ORM\Column(length: 255, nullable: true)]
#[Assert\Length(max: 255)]
private ?string $description = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[Assert\NotNull()]
private ?Media $image = null;
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
#[Assert\NotNull()]
private ?Media $mobileImage = 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 getImage(): ?Media
{
return $this->image;
}
public function setImage(Media $image): self
{
$image->setDirectory('slide');
$this->image = $image;
return $this;
}
public function getMobileImage(): ?Media
{
return $this->mobileImage;
}
public function setMobileImage(Media $image): self
{
$image->setDirectory('slide');
$this->mobileImage = $image;
return $this;
}
}