src/Entity/CmsFaq.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CmsFaqQuestionRepository;
  4. use App\Repository\CmsFaqRepository;
  5. use App\Trait\DateTrait;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassCmsFaqRepository::class)]
  11. class CmsFaq
  12. {
  13.     use DateTrait;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $question null;
  20.     #[ORM\Column(typeTypes::TEXT)]
  21.     private ?string $answer null;
  22.     #[ORM\Column]
  23.     private ?bool $isValidated null;
  24.     #[ORM\Column(options: ['default' => true])]
  25.     private ?bool $isPublic true;
  26.     public function __construct()
  27.     {
  28.         if(!$this->createdAt$this->createdAt = new \DateTimeImmutable();
  29.         $this->updatedAt = new \DateTimeImmutable();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getQuestion(): ?string
  36.     {
  37.         return $this->question;
  38.     }
  39.     public function setQuestion(string $question): self
  40.     {
  41.         $this->question $question;
  42.         return $this;
  43.     }
  44.     public function getAnswer(): ?string
  45.     {
  46.         return $this->answer;
  47.     }
  48.     public function setAnswer(string $answer): self
  49.     {
  50.         $this->answer $answer;
  51.         return $this;
  52.     }
  53.     public function isIsValidated(): ?bool
  54.     {
  55.         return $this->isValidated;
  56.     }
  57.     public function setIsValidated(bool $isValidated): self
  58.     {
  59.         $this->isValidated $isValidated;
  60.         return $this;
  61.     }
  62.     public function isIsPublic(): ?bool
  63.     {
  64.         return $this->isPublic;
  65.     }
  66.     public function setIsPublic(bool $isPublic): self
  67.     {
  68.         $this->isPublic $isPublic;
  69.         return $this;
  70.     }
  71.     public function __toString(): string
  72.     {
  73.         return $this->question;
  74.     }
  75. }