src/Entity/Forum/Category.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Forum;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Table(name="v_forum_category")
  8.  * @ORM\Entity(repositoryClass="App\Repository\Forum\CategoryRepository")
  9.  */
  10. class Category
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @var string
  24.      * @Gedmo\Slug(fields={"name"}, updatable=false)
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $slug;
  28.     /**
  29.      * @ORM\Column(type="text", nullable=true)
  30.      */
  31.     private $description;
  32.     /**
  33.      * @ORM\Column(type="boolean")
  34.      */
  35.     private $recommended false;
  36.     /**
  37.      * @ORM\Column(type="boolean")
  38.      */
  39.     private $trending false;
  40.     /**
  41.      * @ORM\Column(type="boolean")
  42.      */
  43.     private $enabled true;
  44.     /**
  45.      * @Gedmo\SortablePosition
  46.      * @ORM\Column(type="integer")
  47.      */
  48.     private $position;
  49.     use CreatedUpdatedTrait;
  50.     public function __toString()
  51.     {
  52.         return (string) $this->name;
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getName(): ?string
  59.     {
  60.         return $this->name;
  61.     }
  62.     public function setName(string $name): self
  63.     {
  64.         $this->name $name;
  65.         return $this;
  66.     }
  67.     public function getSlug(): ?string
  68.     {
  69.         return $this->slug;
  70.     }
  71.     public function setSlug(string $slug): self
  72.     {
  73.         $this->slug $slug;
  74.         return $this;
  75.     }
  76.     public function getDescription(): ?string
  77.     {
  78.         return $this->description;
  79.     }
  80.     public function setDescription(?string $description): self
  81.     {
  82.         $this->description $description;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return bool
  87.      */
  88.     public function isRecommended(): ?bool
  89.     {
  90.         return $this->recommended;
  91.     }
  92.     /**
  93.      * @param bool $recommended
  94.      */
  95.     public function setRecommended(?bool $recommended): void
  96.     {
  97.         $this->recommended $recommended;
  98.     }
  99.     /**
  100.      * @return bool
  101.      */
  102.     public function isTrending(): ?bool
  103.     {
  104.         return $this->trending;
  105.     }
  106.     /**
  107.      * @param bool $trending
  108.      */
  109.     public function setTrending(?bool $trending): void
  110.     {
  111.         $this->trending $trending;
  112.     }
  113.      /**
  114.      * @return mixed
  115.      */
  116.     public function getEnabled()
  117.     {
  118.         return $this->enabled;
  119.     }
  120.     /**
  121.      * @param mixed $enabled
  122.      */
  123.     public function setEnabled($enabled): void
  124.     {
  125.         $this->enabled $enabled;
  126.     }
  127.     /**
  128.      * @return mixed
  129.      */
  130.     public function getPosition()
  131.     {
  132.         return $this->position;
  133.     }
  134.     /**
  135.      * @param mixed $position
  136.      */
  137.     public function setPosition($position): void
  138.     {
  139.         $this->position $position;
  140.     }
  141. }