src/Entity/FormAnswerFields.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\FormAnswerFieldsRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use ApiPlatform\Metadata\ApiFilter;
  8. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  9. use Doctrine\DBAL\Types\Types;
  10. #[ORM\Entity(repositoryClassFormAnswerFieldsRepository::class)]
  11. #[ApiResource]
  12. #[ApiFilter(SearchFilter::class, properties: [
  13.     'form_answer.id' => 'exact'
  14. ])]
  15. class FormAnswerFields
  16. {
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue]
  19.     #[ORM\Column]
  20.     #[Groups(['formAnswer:read''formAnswer:write''form:read''form:write'])]
  21.     private ?int $id null;
  22.     #[ORM\ManyToOne(inversedBy'formAnswerFields')]
  23.     #[Groups(['form:read''form:write'])]
  24.     private ?FormAnswer $form_answer null;
  25.     #[ORM\Column(length255)]
  26.     #[Groups(['formAnswer:read''formAnswer:write''form:read''form:write'])]
  27.     private ?string $name null;
  28.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  29.     #[Groups(['formAnswer:read''formAnswer:write''form:read''form:write'])]
  30.     private ?string $value null;
  31.     #[Groups(['formAnswer:read''formAnswer:write''form:read''form:write'])]
  32.     #[ORM\ManyToOne(inversedBy'formAnswerFields')]
  33.     private ?FormFields $formField null;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getFormAnswer(): ?FormAnswer
  39.     {
  40.         return $this->form_answer;
  41.     }
  42.     public function setFormAnswer(?FormAnswer $form_answer): self
  43.     {
  44.         $this->form_answer $form_answer;
  45.         return $this;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): self
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     public function getValue(): ?string
  57.     {
  58.         return $this->value;
  59.     }
  60.     public function setValue(string $value): self
  61.     {
  62.         $this->value $value;
  63.         return $this;
  64.     }
  65.     public function getFormField(): ?FormFields
  66.     {
  67.         return $this->formField;
  68.     }
  69.     public function setFormField(?FormFields $formField): self
  70.     {
  71.         $this->formField $formField;
  72.         return $this;
  73.     }
  74. }