<?phpdeclare(strict_types=1);namespace App\Entity\Survey;use App\Entity\Creator;use App\Services\Survey\Repository\UserAnswerRepository;use DateTimeImmutable;use Doctrine\ORM\Mapping\Column;use Doctrine\ORM\Mapping\Entity;use Doctrine\ORM\Mapping\GeneratedValue;use Doctrine\ORM\Mapping\HasLifecycleCallbacks;use Doctrine\ORM\Mapping\Id;use Doctrine\ORM\Mapping\ManyToOne;use Doctrine\ORM\Mapping\PrePersist;use Doctrine\ORM\Mapping\PreUpdate;#[Entity(UserAnswerRepository::class)]#[HasLifecycleCallbacks]class UserAnswer{ #[Id] #[GeneratedValue] #[Column('id', 'bigint', options: ['unsigned' => true])] private int $id; #[ManyToOne(targetEntity: Creator::class)] private Creator $creator; #[ManyToOne(targetEntity: Question::class)] private Question $question; #[ManyToOne(targetEntity: Answer::class)] private ?Answer $answer = null; #[Column(type: 'text')] private ?string $answerText = null; #[Column(name: 'created_at', type: 'datetime_immutable')] private ?DateTimeImmutable $createdAt = null; #[Column(name: 'updated_at', type: 'datetime_immutable', nullable: true)] private ?DateTimeImmutable $updatedAt = null; #[PrePersist] public function prePersist(): void { $this->createdAt = new DateTimeImmutable(); } #[PreUpdate] public function preUpdate(): void { $this->updatedAt = new DateTimeImmutable(); } public function getId(): int { return $this->id; } public function setId(int $id): void { $this->id = $id; } public function getCreator(): Creator { return $this->creator; } public function setCreator(Creator $creator): void { $this->creator = $creator; } public function getQuestion(): Question { return $this->question; } public function setQuestion(Question $question): void { $this->question = $question; } public function getAnswer(): ?Answer { return $this->answer; } public function setAnswer(?Answer $answer): void { $this->answer = $answer; } public function getAnswerText(): ?string { return $this->answerText; } public function setAnswerText(?string $answerText): void { $this->answerText = $answerText; } public function getCreatedAt(): ?DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(?DateTimeImmutable $createdAt): void { $this->createdAt = $createdAt; } public function getUpdatedAt(): ?DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(?DateTimeImmutable $updatedAt): void { $this->updatedAt = $updatedAt; }}