<?php
namespace App\Entity;
use App\Annotation\EsUploadable;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\ElExamTranslationRepository;
use App\Entity\Interfaces\UploadMappedInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Locastic\ApiPlatformTranslationBundle\Model\AbstractTranslation;
use Locastic\ApiPlatformTranslationBundle\Model\TranslatableInterface;
/**
* @ORM\Entity(repositoryClass=ElExamTranslationRepository::class)
*/
class ElExamTranslation extends AbstractTranslation implements UploadMappedInterface
{
/**
* @ORM\ManyToOne(targetEntity="ElExam", inversedBy="translations")
* @ORM\JoinColumn(onDelete="CASCADE")
* @Groups({"ElExam:Write", "ElExamTranslationGroup"})
*/
protected $translatable = null;
/**
* @ORM\Column(type="string", length=16)
* @Groups({"ElExam:Write", "ElExamTranslationGroup"})
*
* @Assert\NotBlank(message="validation.elExamTranslation:locale.notBlank")
*/
protected $locale = null;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"ElExam:Read", "ElExam:Write", "ElExamTranslationGroup", "ElCourse:Read", "ElLession:Read", "ElLessionTopic:Read", "ElTask:Read"})
*
* @Assert\NotBlank(message="validation.elExamTranslation:title.notBlank")
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"ElExam:Read", "ElExam:Write", "ElExamTranslationGroup"})
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"ElExam:Read", "ElExam:Write", "ElExamTranslationGroup"})
*/
private $instruction;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"ElExam:Read-Solution", "ElExam:Write", "ElExamTranslationGroup"})
* @EsUploadable()
*/
protected $uploadVideo;
/**
* @ORM\ManyToOne(targetEntity=Session::class)
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
* @Groups({"ElExam:Read-Solution", "ElExam:Write", "ElExamTranslationGroup"})
*/
private $session;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"ElExam:Read-Solution", "ElExam:Write", "ElExamTranslationGroup"})
*/
private $solutionDescription;
public function __construct($locale = null)
{
$this->setLocale($locale ?? $locale);
}
public function getCopy()
{
$nt = new self($this->locale);
$nt
->setTitle($this->title)
->setDescription($this->description)
->setInstruction($this->instruction)
->setUploadVideo($this->uploadVideo)
->setSession($this->session)
->setSolutionDescription($this->solutionDescription)
;
return $nt;
}
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 getInstruction(): ?string
{
return $this->instruction;
}
public function setInstruction(?string $instruction): self
{
$this->instruction = $instruction;
return $this;
}
public function getUploadVideo(): ?string
{
return $this->uploadVideo;
}
public function setUploadVideo(?string $uploadVideo): self
{
$this->uploadVideo = $uploadVideo;
return $this;
}
public function getSession(): ?Session
{
return $this->session;
}
public function setSession(?Session $session): self
{
$this->session = $session;
return $this;
}
public function getSolutionDescription(): ?string
{
return $this->solutionDescription;
}
public function setSolutionDescription(?string $solutionDescription): self
{
$this->solutionDescription = $solutionDescription;
return $this;
}
}