<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Traits\CreatedUpdatedTrait;
use Gedmo\Mapping\Annotation as Gedmo;
use JMS\Serializer\Annotation\Exclude;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Table(name="v_faq_category")
* @ORM\Entity(repositoryClass="App\Repository\FaqCategoryRepository")
*/
class FaqCategory
{
const CATEGORY_TYPE_FAQ = 'FAQ';
const CATEGORY_TYPE_FOLLOWER_FAQ = 'FOLLOWER_FAQ';
public static function getCategoryTypeDefinitions(){
return [
self::CATEGORY_TYPE_FAQ => 'FAQ',
self::CATEGORY_TYPE_FOLLOWER_FAQ => 'Follower FAQ',
];
}
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $categoryType;
/**
* @ORM\Column(type="boolean")
*/
private $enabled = true;
/**
* @Gedmo\SortablePosition
* @ORM\Column(name="position", type="integer")
*/
private $position;
/**
* @var ArrayCollection
* @ORM\OneToMany(targetEntity="Faq", mappedBy="category")
* @Exclude
*/
private $faqs;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $language;
public function __construct()
{
$this->faqs = new ArrayCollection();
}
use CreatedUpdatedTrait;
public function __toString()
{
return (string) $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return mixed
*/
public function getCategoryType()
{
return $this->categoryType;
}
/**
* @param mixed $categoryType
*/
public function setCategoryType($categoryType): void
{
$this->categoryType = $categoryType;
}
/**
* @return mixed
*/
public function getEnabled()
{
return $this->enabled;
}
/**
* @param mixed $enabled
*/
public function setEnabled($enabled): void
{
$this->enabled = $enabled;
}
/**
* @return ArrayCollection
*/
public function getFaqs()
{
return $this->faqs;
}
/**
* @return mixed
*/
public function getPosition()
{
return $this->position;
}
/**
* @param mixed $position
*/
public function setPosition($position): void
{
$this->position = $position;
}
/**
* @return mixed
*/
public function getLanguage()
{
return $this->language;
}
/**
* @param mixed $language
*/
public function setLanguage($language): void
{
$this->language = $language;
}
}