src/Entity/Feedback.php line 31
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use ApiPlatform\Metadata\Post;use App\Entity\Traits\CreatedAtTrait;use App\Entity\Traits\UpdatedAtTrait;use App\Repository\FeedbackRepository;use App\State\FeedbackCreateProcessor;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Validator\Constraints\Email;use Symfony\Component\Validator\Constraints\Length;use Symfony\Component\Validator\Constraints\NotBlank;#[ORM\HasLifecycleCallbacks]#[ORM\Entity(repositoryClass: FeedbackRepository::class)]#[ApiResource(operations: [new Post(uriTemplate: '/user/feedback',denormalizationContext: ['groups' => 'Feedback:create'],security: "is_granted('ROLE_CLIENT')",validationContext: ['groups' => 'Feedback:create'],processor: FeedbackCreateProcessor::class)],normalizationContext: ['groups' => 'Feedback:read'],)]class Feedback{use CreatedAtTrait;use UpdatedAtTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]#[Groups(['Feedback:read'])]private ?int $id = null;#[ORM\ManyToOne(inversedBy: 'feedbacks')]#[ORM\JoinColumn(nullable: false)]private ?Client $client = null;#[ORM\Column(length: 320)]#[NotBlank(groups: ['Feedback:create'])]#[Email(groups: ['Feedback:create'])]#[Groups(['Feedback:read', 'Feedback:create'])]private ?string $email = null;#[ORM\Column(length: 15)]#[NotBlank(groups: ['Feedback:create'])]#[Length(min: 10, max: 15, groups: ['Feedback:create'])]#[Groups(['Feedback:read', 'Feedback:create'])]private ?string $phone = null;#[ORM\Column(length: 2048)]#[NotBlank(groups: ['Feedback:create'])]#[Length(min: 10, max: 2048, groups: ['Feedback:create'])]#[Groups(['Feedback:read', 'Feedback:create'])]private ?string $text = null;#[ORM\Column]private ?bool $answer = false;#[ORM\ManyToOne]private ?Admin $staffer = null;#[ORM\Column(length: 128)]#[NotBlank(groups: ['Feedback:create'])]#[Length(min: 2, max: 128, groups: ['Feedback:create'])]#[Groups(['Feedback:read', 'Feedback:create'])]private ?string $name = null;public function getId(): ?int{return $this->id;}public function getClient(): ?Client{return $this->client;}public function setClient(?Client $client): self{$this->client = $client;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(string $email): self{$this->email = $email;return $this;}public function getPhone(): ?string{return $this->phone;}public function setPhone(string $phone): self{$this->phone = $phone;return $this;}public function getText(): ?string{return $this->text;}public function setText(string $text): self{$this->text = $text;return $this;}public function isAnswer(): ?bool{return $this->answer;}public function setAnswer(bool $answer): self{$this->answer = $answer;return $this;}public function getStaffer(): ?Admin{return $this->staffer;}public function setStaffer(?Admin $staffer): self{$this->staffer = $staffer;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}}