src/Entity/Faq.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use JMS\Serializer\Annotation\Expose;
  7. use JMS\Serializer\Annotation\Exclude;
  8. use JMS\Serializer\Annotation\ExclusionPolicy;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. /**
  11.  * @ORM\Table(name="v_faq")
  12.  * @ORM\Entity(repositoryClass="App\Repository\FaqRepository")
  13.  * @ExclusionPolicy("all")
  14.  */
  15. class Faq
  16. {
  17.     /**
  18.      * @ORM\Id()
  19.      * @ORM\GeneratedValue()
  20.      * @ORM\Column(type="integer")
  21.      * @Expose
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\FaqCategory", inversedBy="faqs")
  26.      *  @Expose
  27.      */
  28.     private $category;
  29.     /**
  30.      * @ORM\Column(type="text")
  31.      * @Expose
  32.      */
  33.     private $question;
  34.     /**
  35.      * @ORM\Column(type="text")
  36.      * @Expose
  37.      */
  38.     private $answer;
  39.     /**
  40.      * @ORM\Column(type="boolean")
  41.      */
  42.     private $enabled true;
  43.     /**
  44.      * @Gedmo\SortablePosition
  45.      * @ORM\Column(name="position", type="integer")
  46.      */
  47.     private $position;
  48.     /**
  49.      * @ORM\Column(type="string", length=20, nullable=true)
  50.      * @Expose
  51.      */
  52.     private $language;
  53.     use CreatedUpdatedTrait;
  54.     public function __toString()
  55.     {
  56.         return (string) $this->question;
  57.     }
  58.     public function getId(): ?int
  59.     {
  60.         return $this->id;
  61.     }
  62.     /**
  63.      * @return mixed
  64.      */
  65.     public function getCategory()
  66.     {
  67.         return $this->category;
  68.     }
  69.     /**
  70.      * @param mixed $category
  71.      */
  72.     public function setCategory($category): void
  73.     {
  74.         $this->category $category;
  75.     }
  76.     public function getQuestion(): ?string
  77.     {
  78.         return $this->question;
  79.     }
  80.     public function setQuestion(string $question): self
  81.     {
  82.         $this->question $question;
  83.         return $this;
  84.     }
  85.     public function getAnswer(): ?string
  86.     {
  87.         return $this->answer;
  88.     }
  89.     public function setAnswer(string $answer): self
  90.     {
  91.         $this->answer $answer;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return mixed
  96.      */
  97.     public function getEnabled()
  98.     {
  99.         return $this->enabled;
  100.     }
  101.     /**
  102.      * @param mixed $enabled
  103.      */
  104.     public function setEnabled($enabled): void
  105.     {
  106.         $this->enabled $enabled;
  107.     }
  108.     /**
  109.      * @return mixed
  110.      */
  111.     public function getPosition()
  112.     {
  113.         return $this->position;
  114.     }
  115.     /**
  116.      * @param mixed $position
  117.      */
  118.     public function setPosition($position): void
  119.     {
  120.         $this->position $position;
  121.     }
  122.     /**
  123.      * @return mixed
  124.      */
  125.     public function getLanguage()
  126.     {
  127.         return $this->language;
  128.     }
  129.     /**
  130.      * @param mixed $language
  131.      */
  132.     public function setLanguage($language): void
  133.     {
  134.         $this->language $language;
  135.     }
  136. }