src/Entity/CRM/SurveyQuestion.php line 11
<?php// src/Entity/SurveyQuestion.phpnamespace App\Entity\CRM;use App\Repository\SurveyQuestionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: SurveyQuestionRepository::class)]class SurveyQuestion{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(type: 'integer')]private ?int $id = null;#[ORM\Column(type: 'text')]private ?string $questionText = null;#[ORM\ManyToOne(targetEntity: Survey::class, inversedBy: 'questions')]#[ORM\JoinColumn(nullable: false)]private ?Survey $survey = null;#[ORM\Column]private ?bool $isActive = null;#[ORM\OneToMany(mappedBy: 'surveyQuestion', targetEntity: SurveyResponse::class)]private Collection $surveyResponses;public function __construct(){$this->surveyResponses = new ArrayCollection();}public function __toString(): string{return $this->questionText;}public function getId(): ?int{return $this->id;}public function getQuestionText(): ?string{return $this->questionText;}public function setQuestionText(string $questionText): self{$this->questionText = $questionText;return $this;}public function getSurvey(): ?Survey{return $this->survey;}public function setSurvey(?Survey $survey): self{$this->survey = $survey;return $this;}public function isIsActive(): ?bool{return $this->isActive;}public function setIsActive(bool $isActive): static{$this->isActive = $isActive;return $this;}/*** @return Collection<int, SurveyResponse>*/public function getSurveyResponses(): Collection{return $this->surveyResponses;}public function addSurveyResponse(SurveyResponse $surveyResponse): static{if (!$this->surveyResponses->contains($surveyResponse)) {$this->surveyResponses->add($surveyResponse);$surveyResponse->setSurveyQuestion($this);}return $this;}public function removeSurveyResponse(SurveyResponse $surveyResponse): static{if ($this->surveyResponses->removeElement($surveyResponse)) {// set the owning side to null (unless already changed)if ($surveyResponse->getSurveyQuestion() === $this) {$surveyResponse->setSurveyQuestion(null);}}return $this;}}