<?php
namespace App\Entity;
use App\Repository\FaqAnswerRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FaqAnswerRepository::class)
*/
class FaqAnswer extends BaseEntity
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToMany(targetEntity=FaqQuestion::class, mappedBy="faqAnswers")
*/
private $faqQuestions;
/**
* @ORM\Column(type="text")
*/
private $answer;
public function __construct()
{
$this->faqQuestions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection<int, FaqQuestion>
*/
public function getFaqQuestions(): Collection
{
return $this->faqQuestions;
}
public function addFaqQuestion(FaqQuestion $faqQuestion): self
{
if (!$this->faqQuestions->contains($faqQuestion)) {
$this->faqQuestions[] = $faqQuestion;
$faqQuestion->addFaqAnswer($this);
}
return $this;
}
public function removeFaqQuestion(FaqQuestion $faqQuestion): self
{
if ($this->faqQuestions->removeElement($faqQuestion)) {
$faqQuestion->removeFaqAnswer($this);
}
return $this;
}
public function getAnswer(): ?string
{
return $this->answer;
}
public function setAnswer(string $answer): self
{
$this->answer = $answer;
return $this;
}
}