<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\FormAnswerFieldsRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Metadata\ApiFilter;
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
use Doctrine\DBAL\Types\Types;
#[ORM\Entity(repositoryClass: FormAnswerFieldsRepository::class)]
#[ApiResource]
#[ApiFilter(SearchFilter::class, properties: [
'form_answer.id' => 'exact'
])]
class FormAnswerFields
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['formAnswer:read', 'formAnswer:write', 'form:read', 'form:write'])]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'formAnswerFields')]
#[Groups(['form:read', 'form:write'])]
private ?FormAnswer $form_answer = null;
#[ORM\Column(length: 255)]
#[Groups(['formAnswer:read', 'formAnswer:write', 'form:read', 'form:write'])]
private ?string $name = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
#[Groups(['formAnswer:read', 'formAnswer:write', 'form:read', 'form:write'])]
private ?string $value = null;
#[Groups(['formAnswer:read', 'formAnswer:write', 'form:read', 'form:write'])]
#[ORM\ManyToOne(inversedBy: 'formAnswerFields')]
private ?FormFields $formField = null;
public function getId(): ?int
{
return $this->id;
}
public function getFormAnswer(): ?FormAnswer
{
return $this->form_answer;
}
public function setFormAnswer(?FormAnswer $form_answer): self
{
$this->form_answer = $form_answer;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
public function getFormField(): ?FormFields
{
return $this->formField;
}
public function setFormField(?FormFields $formField): self
{
$this->formField = $formField;
return $this;
}
}