src/Entity/FAQ.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FAQRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassFAQRepository::class)]
  9. class FAQ
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $question null;
  17.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  18.     private ?string $answer null;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?int $sequence null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?bool $isActive null;
  23.     #[ORM\OneToMany(mappedBy'faq'targetEntityFAQTranslation::class)]
  24.     private Collection $fAQTranslations;
  25.     public function __construct()
  26.     {
  27.         $this->fAQTranslations = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getQuestion(): ?string
  34.     {
  35.         return $this->question;
  36.     }
  37.     public function setQuestion(?string $question): self
  38.     {
  39.         $this->question $question;
  40.         return $this;
  41.     }
  42.     public function getAnswer(): ?string
  43.     {
  44.         return $this->answer;
  45.     }
  46.     public function setAnswer(?string $answer): self
  47.     {
  48.         $this->answer $answer;
  49.         return $this;
  50.     }
  51.     public function getSequence(): ?int
  52.     {
  53.         return $this->sequence;
  54.     }
  55.     public function setSequence(?int $sequence): self
  56.     {
  57.         $this->sequence $sequence;
  58.         return $this;
  59.     }
  60.     public function isIsActive(): ?bool
  61.     {
  62.         return $this->isActive;
  63.     }
  64.     public function setIsActive(?bool $isActive): self
  65.     {
  66.         $this->isActive $isActive;
  67.         return $this;
  68.     }
  69.     /**
  70.      * @return Collection<int, FAQTranslation>
  71.      */
  72.     public function getFAQTranslations(): Collection
  73.     {
  74.         return $this->fAQTranslations;
  75.     }
  76.     public function addFAQTranslation(FAQTranslation $fAQTranslation): self
  77.     {
  78.         if (!$this->fAQTranslations->contains($fAQTranslation)) {
  79.             $this->fAQTranslations->add($fAQTranslation);
  80.             $fAQTranslation->setFaq($this);
  81.         }
  82.         return $this;
  83.     }
  84.     public function removeFAQTranslation(FAQTranslation $fAQTranslation): self
  85.     {
  86.         if ($this->fAQTranslations->removeElement($fAQTranslation)) {
  87.             // set the owning side to null (unless already changed)
  88.             if ($fAQTranslation->getFaq() === $this) {
  89.                 $fAQTranslation->setFaq(null);
  90.             }
  91.         }
  92.         return $this;
  93.     }
  94. }