<?phpnamespace App\Entity;use App\Repository\QuizAnswerRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use JMS\Serializer\Annotation as Serializer;/** * @ORM\Entity(repositoryClass=QuizAnswerRepository::class) * @Serializer\ExclusionPolicy("ALL") */class QuizAnswer{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") * @Serializer\Expose */ private $id; /** * @ORM\Column(type="text") * @Serializer\Expose */ private $response; /** * @ORM\ManyToOne(targetEntity=QuizQuestion::class, inversedBy="quizAnswers") */ private $question; /** * @ORM\Column(type="boolean", nullable=true) * @Serializer\Expose */ private $isCorrect; /** * @ORM\ManyToMany(targetEntity=UserQuizQuestion::class, mappedBy="quizAnswers") */ private $userQuizQuestions; /** * @ORM\Column(type="text", nullable=true) * @Serializer\Expose */ private $correctResponse; /** * @ORM\Column(type="integer", nullable=true) * @Serializer\Expose */ private $responseOrder; public function __construct() { $this->userQuizQuestions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getResponse(): ?string { return $this->response; } public function setResponse(string $response): self { $this->response = $response; return $this; } public function getQuestion(): ?QuizQuestion { return $this->question; } public function setQuestion(?QuizQuestion $question): self { $this->question = $question; return $this; } public function isIsCorrect(): ?bool { return $this->isCorrect; } public function setIsCorrect(?bool $isCorrect): self { $this->isCorrect = $isCorrect; return $this; } /** * @return Collection<int, UserQuizQuestion> */ public function getUserQuizQuestions(): Collection { return $this->userQuizQuestions; } public function addUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self { if (!$this->userQuizQuestions->contains($userQuizQuestion)) { $this->userQuizQuestions[] = $userQuizQuestion; $userQuizQuestion->addQuizAnswer($this); } return $this; } public function removeUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self { if ($this->userQuizQuestions->removeElement($userQuizQuestion)) { $userQuizQuestion->removeQuizAnswer($this); } return $this; } public function getCorrectResponse(): ?string { return $this->correctResponse; } public function setCorrectResponse(?string $correctResponse): self { $this->correctResponse = $correctResponse; return $this; } public function getResponseOrder(): ?int { return $this->responseOrder; } public function setResponseOrder(?int $responseOrder): self { $this->responseOrder = $responseOrder; return $this; }}