src/Entity/HomeSlideTranslation.php line 31

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM,
  4.     Doctrine\DBAL\Types\Types,
  5.     Doctrine\Common\Collections\ArrayCollection;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use ApiPlatform\Metadata\ApiProperty,
  8.     ApiPlatform\Metadata\ApiResource,
  9.     ApiPlatform\Metadata\Get;
  10. use App\Entity\Trait\IdTrait,
  11.     App\Entity\Trait\UuidTrait,
  12.     App\Entity\Trait\TimestampableTrait,
  13.     App\Entity\Trait\TranslationTrait,
  14.     App\Entity\Trait\Media\ImageThumbableTrait,
  15.     App\Entity\Interface\TranslationInterface,
  16.     App\Entity\Interface\ThumbableInterface;
  17. use App\Enum\Language,
  18.     App\Repository\HomeSlideTranslationRepository;
  19. #[ApiResource(
  20.     security'is_granted("' HomeSlide::class . '")',
  21.     operations: [ new Get() ],
  22.     extraProperties: ['standard_put' => false],
  23. )]
  24. #[ORM\Entity(repositoryClassHomeSlideTranslationRepository::class)]
  25. class HomeSlideTranslation implements TranslationInterfaceThumbableInterface
  26. {
  27.     use IdTrait,
  28.         UuidTrait,
  29.         TimestampableTrait,
  30.         TranslationTrait,
  31.         ImageThumbableTrait;
  32.     #[ApiProperty(description'Title')]
  33.     #[Groups(['read''write'])]
  34.     #[ORM\Column(typeTypes::STRINGlength511nullabletrue)]
  35.     private ?string $title null;
  36.     #[ApiProperty(description'Text')]
  37.     #[Groups(['read:' self::class, 'write'])]
  38.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  39.     private ?string $text null;
  40.     #[ApiProperty(description'CTA')]
  41.     #[Groups(['read:' self::class, 'write'])]
  42.     #[ORM\Column(typeTypes::STRINGlength255nullabletrue)]
  43.     private ?string $cta null;
  44.     #[ApiProperty(description'Alt')]
  45.     #[Groups(['read:' self::class, 'write'])]
  46.     #[ORM\Column(typeTypes::STRINGlength511nullabletrue)]
  47.     private ?string $alt null;
  48.     #[ApiProperty(description'Link')]
  49.     #[Groups(['read:' self::class, 'write'])]
  50.     #[ORM\Column(typeTypes::STRINGlength511nullabletrue)]
  51.     private ?string $link null;
  52.     public function __construct(HomeSlide $parentLanguage $lang)
  53.     {
  54.         $this->setUuid();
  55.         $this->parent $parent;
  56.         $this->lang $lang;
  57.         $this->thumbs = new ArrayCollection();
  58.         $this->createdAt = new \DateTimeImmutable();
  59.         $this->updatedAt = new \DateTimeImmutable();
  60.         $parent->addTranslation($this);
  61.     }
  62.     public function getTitle(): ?string
  63.     {
  64.         return $this->title;
  65.     }
  66.     public function setTitle(?string $title): self
  67.     {
  68.         $this->title $title;
  69.         return $this;
  70.     }
  71.     public function getText(): ?string
  72.     {
  73.         return $this->text;
  74.     }
  75.     public function setText(?string $text): self
  76.     {
  77.         $this->text $text;
  78.         return $this;
  79.     }
  80.     public function getCta(): ?string
  81.     {
  82.         return $this->cta;
  83.     }
  84.     public function setCta(?string $cta): self
  85.     {
  86.         $this->cta $cta;
  87.         return $this;
  88.     }
  89.     public function getAlt(): ?string
  90.     {
  91.         return $this->alt;
  92.     }
  93.     public function setAlt(?string $alt): self
  94.     {
  95.         $this->alt $alt;
  96.         return $this;
  97.     }
  98.     public function getLink(): ?string
  99.     {
  100.         return $this->link;
  101.     }
  102.     public function setLink(?string $link): self
  103.     {
  104.         $this->link $link;
  105.         return $this;
  106.     }
  107. }