src/Entity/ConferenceTranslation.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\ConferenceTranslationRepository;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Locastic\ApiPlatformTranslationBundle\Model\AbstractTranslation;
  8. use Locastic\ApiPlatformTranslationBundle\Model\TranslatableInterface;
  9. /**
  10.  * @ORM\Entity(repositoryClass=ConferenceTranslationRepository::class)
  11.  */
  12. class ConferenceTranslation extends AbstractTranslation
  13. {
  14.     /**
  15.      * @ORM\ManyToOne(targetEntity="Conference", inversedBy="translations")
  16.      * @ORM\JoinColumn(onDelete="CASCADE")
  17.      * @Groups({"Conference:Write", "translations"})
  18.      */
  19.     protected $translatable null;
  20.     /**
  21.      * @ORM\Column(type="string", length=16)
  22.      * @Groups({"Conference:EL", "Conference:Write", "translations", "Session:VideoLibrary"})
  23.      * 
  24.      * @Assert\NotBlank(message="validation.conferenceTranslation:locale.notBlank")
  25.      */
  26.     protected $locale null;
  27.     /**
  28.      * @ORM\Id
  29.      * @ORM\GeneratedValue
  30.      * @ORM\Column(type="integer")
  31.      */
  32.     private $id;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      * @Groups({"Conference:EL", "Conference:Read", "Conference:Write", "translations", "Session:VideoLibrary", "Conference:PRead"})
  36.      * 
  37.      * @Assert\NotBlank(message="validation.conferenceTranslation:title.notBlank")
  38.      */
  39.     private $title;
  40.     /**
  41.      * @ORM\Column(type="text", nullable=true)
  42.      * @Groups({"Conference:EL", "Conference:Read", "Conference:Write", "translations", "Conference:PRead"})
  43.      */
  44.     private $description;
  45.     public function __construct($locale null)
  46.     {
  47.         $this->setLocale($locale ?? $locale);
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getTitle(): ?string
  54.     {
  55.         return $this->title;
  56.     }
  57.     public function setTitle(string $title): self
  58.     {
  59.         $this->title $title;
  60.         return $this;
  61.     }
  62.     public function getDescription(): ?string
  63.     {
  64.         return $this->description;
  65.     }
  66.     public function setDescription(?string $description): self
  67.     {
  68.         $this->description $description;
  69.         return $this;
  70.     }
  71. }