<?php
namespace App\Entity\Web;
use App\Repository\Web\ModalTranslationRepository;
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_modal_translation")
* @ORM\Entity(repositoryClass=ModalTranslationRepository::class)
* @ORM\EntityListeners({"App\Listener\EntityListener"})
* @Vich\Uploadable()
*/
class ModalTranslation implements TranslationInterface
{
use TranslationTrait;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $title;
/**
* @Vich\UploadableField(mapping="modal", 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;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $text;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $url;
/**
* @ORM\Column(type="string", length=2)
*/
protected $locale;
/**
* @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 getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getText(): ?string
{
return $this->text;
}
public function setText(?string $text): self
{
$this->text = $text;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
/**
* @return mixed
*/
public function getLocale(): string
{
return $this->locale;
}
/**
* @param mixed $locale
*/
public function setLocale($locale): void
{
$this->locale = $locale;
}
/**
* @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;
}
/**
* 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();
}
}
}