<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\ConferenceTranslationRepository;
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=ConferenceTranslationRepository::class)
*/
class ConferenceTranslation extends AbstractTranslation
{
/**
* @ORM\ManyToOne(targetEntity="Conference", inversedBy="translations")
* @ORM\JoinColumn(onDelete="CASCADE")
* @Groups({"Conference:Write", "translations"})
*/
protected $translatable = null;
/**
* @ORM\Column(type="string", length=16)
* @Groups({"Conference:EL", "Conference:Write", "translations", "Session:VideoLibrary"})
*
* @Assert\NotBlank(message="validation.conferenceTranslation:locale.notBlank")
*/
protected $locale = null;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"Conference:EL", "Conference:Read", "Conference:Write", "translations", "Session:VideoLibrary", "Conference:PRead"})
*
* @Assert\NotBlank(message="validation.conferenceTranslation:title.notBlank")
*/
private $title;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"Conference:EL", "Conference:Read", "Conference:Write", "translations", "Conference:PRead"})
*/
private $description;
public function __construct($locale = null)
{
$this->setLocale($locale ?? $locale);
}
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;
}
}