src/Entity/FaqCategory.php line 15

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\Exclude;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. /**
  9.  * @ORM\Table(name="v_faq_category")
  10.  * @ORM\Entity(repositoryClass="App\Repository\FaqCategoryRepository")
  11.  */
  12. class FaqCategory
  13. {
  14.     const CATEGORY_TYPE_FAQ 'FAQ';
  15.     const CATEGORY_TYPE_FOLLOWER_FAQ 'FOLLOWER_FAQ';
  16.     public static function getCategoryTypeDefinitions(){
  17.         return [
  18.             self::CATEGORY_TYPE_FAQ => 'FAQ',
  19.             self::CATEGORY_TYPE_FOLLOWER_FAQ => 'Follower FAQ',
  20.         ];
  21.     }
  22.     /**
  23.      * @ORM\Id()
  24.      * @ORM\GeneratedValue()
  25.      * @ORM\Column(type="integer")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $name;
  32.     /**
  33.      * @ORM\Column(type="text", nullable=true)
  34.      */
  35.     private $description;
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     private $categoryType;
  40.     /**
  41.      * @ORM\Column(type="boolean")
  42.      */
  43.     private $enabled true;
  44.     /**
  45.      * @Gedmo\SortablePosition
  46.      * @ORM\Column(name="position", type="integer")
  47.      */
  48.     private $position;
  49.     /**
  50.      * @var ArrayCollection
  51.      * @ORM\OneToMany(targetEntity="Faq", mappedBy="category")
  52.      * @Exclude
  53.      */
  54.     private $faqs;
  55.     /**
  56.      * @ORM\Column(type="string", length=20, nullable=true)
  57.      */
  58.     private $language;
  59.     public function __construct()
  60.     {
  61.         $this->faqs = new ArrayCollection();
  62.     }
  63.     use CreatedUpdatedTrait;
  64.     public function __toString()
  65.     {
  66.         return (string) $this->name;
  67.     }
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getName(): ?string
  73.     {
  74.         return $this->name;
  75.     }
  76.     public function setName(string $name): self
  77.     {
  78.         $this->name $name;
  79.         return $this;
  80.     }
  81.     public function getDescription(): ?string
  82.     {
  83.         return $this->description;
  84.     }
  85.     public function setDescription(?string $description): self
  86.     {
  87.         $this->description $description;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return mixed
  92.      */
  93.     public function getCategoryType()
  94.     {
  95.         return $this->categoryType;
  96.     }
  97.     /**
  98.      * @param mixed $categoryType
  99.      */
  100.     public function setCategoryType($categoryType): void
  101.     {
  102.         $this->categoryType $categoryType;
  103.     }
  104.     /**
  105.      * @return mixed
  106.      */
  107.     public function getEnabled()
  108.     {
  109.         return $this->enabled;
  110.     }
  111.     /**
  112.      * @param mixed $enabled
  113.      */
  114.     public function setEnabled($enabled): void
  115.     {
  116.         $this->enabled $enabled;
  117.     }
  118.     /**
  119.      * @return ArrayCollection
  120.      */
  121.     public function getFaqs()
  122.     {
  123.         return $this->faqs;
  124.     }
  125.     /**
  126.      * @return mixed
  127.      */
  128.     public function getPosition()
  129.     {
  130.         return $this->position;
  131.     }
  132.     /**
  133.      * @param mixed $position
  134.      */
  135.     public function setPosition($position): void
  136.     {
  137.         $this->position $position;
  138.     }
  139.     /**
  140.      * @return mixed
  141.      */
  142.     public function getLanguage()
  143.     {
  144.         return $this->language;
  145.     }
  146.     /**
  147.      * @param mixed $language
  148.      */
  149.     public function setLanguage($language): void
  150.     {
  151.         $this->language $language;
  152.     }
  153. }