src/Entity/QuestionTranslation.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\QuestionTranslationRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. #[ORM\Entity(repositoryClassQuestionTranslationRepository::class)]
  8. /*#[ApiResource(
  9.     collectionOperations: [
  10.         'get'=>['normalization_context' => ['groups' => 'readQuestions']],
  11.         'post',
  12.     ],
  13.     itemOperations: [
  14.         'get'=>['normalization_context' => ['groups' => 'readQuestions']],
  15.         'put',
  16.         'delete',
  17.         
  18.     ],
  19. )]*/
  20. class QuestionTranslation
  21. {
  22.     #[ORM\Id]
  23.     #[ORM\GeneratedValue]
  24.     #[ORM\Column]
  25.     private ?int $id null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     #[Groups("readQuestions")]
  28.     private ?string $content null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     #[Groups("readQuestions")]
  31.     private ?string $locale null;
  32.     #[ORM\ManyToOne(inversedBy'translations')]
  33.     private ?Question $question null;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getContent(): ?string
  39.     {
  40.         return $this->content;
  41.     }
  42.     public function setContent(?string $content): self
  43.     {
  44.         $this->content $content;
  45.         return $this;
  46.     }
  47.     public function getLocale(): ?string
  48.     {
  49.         return $this->locale;
  50.     }
  51.     public function setLocale(?string $locale): self
  52.     {
  53.         $this->locale $locale;
  54.         return $this;
  55.     }
  56.     public function getQuestion(): ?Question
  57.     {
  58.         return $this->question;
  59.     }
  60.     public function setQuestion(?Question $question): self
  61.     {
  62.         $this->question $question;
  63.         return $this;
  64.     }
  65. }