src/Entity/JournalScientificCouncilMemberTranslation.php line 28

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM,
  4.     Doctrine\DBAL\Types\Types;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use ApiPlatform\Metadata\ApiProperty,
  7.     ApiPlatform\Metadata\ApiResource,
  8.     ApiPlatform\Metadata\Get;
  9. use App\Entity\Interface\TranslationInterface,
  10.     App\Entity\Trait\IdTrait,
  11.     App\Entity\Trait\UuidTrait,
  12.     App\Entity\Trait\TimestampableTrait,
  13.     App\Entity\Trait\TranslationTrait,
  14.     App\Repository\JournalScientificCouncilMemberTranslationRepository;
  15. use App\Enum\Language;
  16. #[ApiResource(
  17.     security'is_granted("' Journal::class . '")',
  18.     operations: [ new Get() ],
  19.     extraProperties: ['standard_put' => false],
  20. )]
  21. #[ORM\Entity(repositoryClassJournalScientificCouncilMemberTranslationRepository::class)]
  22. class JournalScientificCouncilMemberTranslation implements TranslationInterface
  23. {
  24.     use IdTrait,
  25.         UuidTrait,
  26.         TimestampableTrait,
  27.         TranslationTrait;
  28.     #[ApiProperty(description'Role')]
  29.     #[Groups(['read:' self::class, 'write'])]
  30.     #[ORM\Column(typeTypes::STRINGlength511nullabletrue)]
  31.     private ?string $role null;
  32.     #[ApiProperty(description'Prefix')]
  33.     #[Groups(['read:' self::class, 'write'])]
  34.     #[ORM\Column(typeTypes::STRINGlength255nullabletrue)]
  35.     private ?string $prefix null;
  36.     #[ApiProperty(description'Description')]
  37.     #[Groups(['read:' self::class, 'write'])]
  38.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  39.     private ?string $description null;
  40.     public function __construct(JournalScientificCouncilMember $parentLanguage $lang)
  41.     {
  42.         $this->setUuid();
  43.         $this->parent $parent;
  44.         $this->lang $lang;
  45.         $this->createdAt = new \DateTimeImmutable();
  46.         $this->updatedAt = new \DateTimeImmutable();
  47.         $parent->addTranslation($this);
  48.     }
  49.     public function getRole(): ?string
  50.     {
  51.         return $this->role;
  52.     }
  53.     public function setRole(?string $role): self
  54.     {
  55.         $this->role $role;
  56.         return $this;
  57.     }
  58.     public function getPrefix(): ?string
  59.     {
  60.         return $this->prefix;
  61.     }
  62.     public function setPrefix(?string $prefix): self
  63.     {
  64.         $this->prefix $prefix;
  65.         return $this;
  66.     }
  67.     public function getDescription(): ?string
  68.     {
  69.         return $this->description;
  70.     }
  71.     public function setDescription(?string $description): self
  72.     {
  73.         $this->description $description;
  74.         return $this;
  75.     }
  76. }