src/Entity/AnswerTranslation.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\AnswerTranslationRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. #[ORM\Entity(repositoryClassAnswerTranslationRepository::class)]
  8. /*#[ApiResource(
  9.     collectionOperations: [
  10.         'get'=>['normalization_context' => ['groups' => 'readQuestions']],
  11.         'post',
  12.     ],
  13.     itemOperations: [
  14.         'get'=>['normalization_context' => ['groups' => 'readQuestions']],
  15.         
  16.         'delete',
  17.         
  18.     ],
  19. )]*/
  20. class AnswerTranslation
  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 $value null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     #[Groups("readQuestions")]
  31.     private ?string $locale null;
  32.     #[ORM\ManyToOne(inversedBy'translations')]
  33.     private ?Answer $answer null;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getValue(): ?string
  39.     {
  40.         return $this->value;
  41.     }
  42.     public function setValue(?string $value): self
  43.     {
  44.         $this->value $value;
  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 getAnswer(): ?Answer
  57.     {
  58.         return $this->answer;
  59.     }
  60.     public function setAnswer(?Answer $answer): self
  61.     {
  62.         $this->answer $answer;
  63.         return $this;
  64.     }
  65. }