<?php
namespace App\Entity\Web;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Behaviors\TranslationTrait;
use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="web_slide_show_translation")
* @ORM\Entity(repositoryClass="App\Repository\TranslationRepository")
* @ORM\EntityListeners({"App\Listener\EntityListener"})
* @Vich\Uploadable()
*/
class SlideShowTranslation implements TranslationInterface
{
use TranslationTrait;
/**
* @ORM\Column(type="string", length=2)
*/
protected $locale;
/**
* @ORM\Column(type="string", length=255)
*/
private string $label;
/**
* @ORM\Column(type="string", length=255)
*/
private string $title;
/**
* @ORM\Column(type="string", length=255)
*/
private string $subtitle;
/**
* @ORM\Column(type="string", length=255)
*/
private string $url;
/**
* @Vich\UploadableField(mapping="slideshow", fileNameProperty="image")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $imageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @Vich\UploadableField(mapping="slideshow_mobile", fileNameProperty="imageMobile")
* @Assert\Image(mimeTypes={"image/png", "image/jpeg", "image/jpg", "image/gif"})
* @var File|null
*/
private $imageMobileFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $imageMobile;
/**
* @ORM\Column(type="datetime")
*/
private $createts;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User")
* @ORM\JoinColumn(nullable=false)
*/
private $createUser;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $editts;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User")
*/
private $editUser;
public function __construct($locale = null) {
if($locale !== null){
$this->setLocale($locale);
}
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(string $url): self
{
$this->url = $url;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getImageMobile(): ?string
{
return $this->imageMobile;
}
public function setImageMobile(?string $imageMobile): self
{
$this->imageMobile = $imageMobile;
return $this;
}
/**
* Get ImageFile
*
* @return null|File
*/
public function getImageFile()
{
return $this->imageFile;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setImageFile(?File $imageFile = null): void
{
$this->imageFile = $imageFile;
if (null !== $imageFile) {
$this->editts = new \DateTime();
}
}
/**
* Get ImageMobileFile
*
* @return null|File
*/
public function getImageMobileFile()
{
return $this->imageMobileFile;
}
/**
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageMobileFile
*/
public function setImageMobileFile(?File $imageMobileFile = null): void
{
$this->imageMobileFile = $imageMobileFile;
if (null !== $imageMobileFile) {
$this->editts = new \DateTime();
}
}
/**
* @return mixed
*/
public function getCreatets()
{
return $this->createts;
}
/**
* @param mixed $createts
*/
public function setCreatets($createts): void
{
$this->createts = $createts;
}
/**
* @return mixed
*/
public function getCreateUser()
{
return $this->createUser;
}
/**
* @param mixed $createUser
*/
public function setCreateUser($createUser): void
{
$this->createUser = $createUser;
}
/**
* @return mixed
*/
public function getEditts()
{
return $this->editts;
}
/**
* @param mixed $editts
*/
public function setEditts($editts): void
{
$this->editts = $editts;
}
/**
* @return mixed
*/
public function getEditUser()
{
return $this->editUser;
}
/**
* @param mixed $editUser
*/
public function setEditUser($editUser): void
{
$this->editUser = $editUser;
}
/**
* @return string
*/
public function getTitle(): string
{
return $this->title;
}
/**
* @param string $title
*/
public function setTitle(string $title): void
{
$this->title = $title;
}
/**
* @return string
*/
public function getSubtitle(): string
{
return $this->subtitle;
}
/**
* @param string $subtitle
*/
public function setSubtitle(string $subtitle): void
{
$this->subtitle = $subtitle;
}
}