<?phpnamespace App\Entity;use App\Repository\FaqQuestionRepository;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=FaqQuestionRepository::class) * @Serializer\ExclusionPolicy("ALL") */class FaqQuestion extends BaseEntity{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") * @Serializer\Expose */ private $id; /** * @ORM\Column(type="string", length=255) * @Serializer\Expose */ private $question; /** * @ORM\ManyToMany(targetEntity=FaqSubject::class, mappedBy="questions") */ private $faqSubjects; /** * @ORM\Column(type="text") * @Serializer\Expose */ private $answer; /** * @ORM\ManyToMany(targetEntity=FaqAnswer::class, inversedBy="faqQuestions") */ private $faqAnswers; public function __construct() { $this->faqSubjects = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getQuestion(): ?string { return $this->question; } public function setQuestion(string $question): self { $this->question = $question; return $this; } /** * @return Collection<int, FaqSubject> */ public function getFaqSubjects(): Collection { return $this->faqSubjects; } public function addFaqSubject(FaqSubject $faqSubject): self { if (!$this->faqSubjects->contains($faqSubject)) { $this->faqSubjects[] = $faqSubject; $faqSubject->addQuestion($this); } return $this; } public function removeFaqSubject(FaqSubject $faqSubject): self { if ($this->faqSubjects->removeElement($faqSubject)) { $faqSubject->removeQuestion($this); } return $this; } public function getAnswer(): ?string { return $this->answer; } public function setAnswer(string $answer): self { $this->answer = $answer; return $this; } /** * @return Collection<int, FaqAnswer> */ public function getFaqAnswers(): Collection { return $this->faqAnswers; } public function addFaqAnswer(FaqAnswer $faqAnswer): self { if (!$this->faqAnswers->contains($faqAnswer)) { $this->faqAnswers[] = $faqAnswer; $faqAnswer->addFaqQuestion($this); } return $this; } public function removeFaqAnswer(FaqAnswer $faqAnswer): self { if ($this->faqAnswers->removeElement($faqAnswer)) { $faqAnswer->removeFaqQuestion($this); } return $this; }}