<?phpnamespace App\Entity;use App\Repository\QuestionResponseRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: QuestionResponseRepository::class)]class QuestionResponse{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\ManyToOne(inversedBy: 'responses')] #[ORM\JoinColumn(nullable: false)] private ?Question $question = null; #[ORM\ManyToOne(inversedBy: 'questionResponses')] #[ORM\JoinColumn(nullable: false)] private ?SurveyResponse $surveyResponse = null; #[ORM\Column(type: 'text', nullable: true)] private ?string $textResponse = null; #[ORM\ManyToMany(targetEntity: QuestionOption::class)] private Collection $selectedOptions; #[ORM\Column(length: 255, nullable: true)] private ?string $imageFilename = null; public function __construct() { $this->selectedOptions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getQuestion(): ?Question { return $this->question; } public function setQuestion(?Question $question): self { $this->question = $question; return $this; } public function getSurveyResponse(): ?SurveyResponse { return $this->surveyResponse; } public function setSurveyResponse(?SurveyResponse $surveyResponse): self { $this->surveyResponse = $surveyResponse; return $this; } public function getTextResponse(): ?string { return $this->textResponse; } public function setTextResponse(?string $textResponse): self { $this->textResponse = $textResponse; return $this; } /** * @return Collection<int, QuestionOption> */ public function getSelectedOptions(): Collection { return $this->selectedOptions; } public function addSelectedOption(QuestionOption $option): self { if (!$this->selectedOptions->contains($option)) { $this->selectedOptions->add($option); } return $this; } public function removeSelectedOption(QuestionOption $option): self { $this->selectedOptions->removeElement($option); return $this; } public function getImageFilename(): ?string { return $this->imageFilename; } public function setImageFilename(?string $imageFilename): self { $this->imageFilename = $imageFilename; return $this; }}