src/Entity/Category.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use JMS\Serializer\Annotation\Groups;
  5. /**
  6.  * @ORM\Table("Category")
  7.  *
  8.  * @ORM\Entity(repositoryClass="App\Repository\CategoryRepository")
  9.  */
  10. class Category
  11. {
  12.     /**
  13.      * @Groups({"categorylist", "contentdetail", "video_search", "imageset_search"})
  14.      *
  15.      * @ORM\Id()
  16.      *
  17.      * @ORM\GeneratedValue("AUTO")
  18.      *
  19.      * @ORM\Column(type="integer")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @Groups({"categorylist", "video_search", "imageset_search"})
  24.      *
  25.      * @ORM\Column(type="string", length=100)
  26.      */
  27.     private $name;
  28.     /**
  29.      * @Groups({"categorylist", "video_search"})
  30.      *
  31.      * @ORM\Column(type="string", length=100)
  32.      */
  33.     private $videoSlug;
  34.     /**
  35.      * @Groups({"categorylist", "imageset_search"})
  36.      *
  37.      * @ORM\Column(type="string", length=100)
  38.      */
  39.     private $imagesetSlug;
  40.     /**
  41.      * @Groups({"categorydetail", "video_search", "imageset_search"})
  42.      *
  43.      * @ORM\ManyToOne(targetEntity="App\Entity\CategoryGroup", inversedBy="categories")
  44.      *
  45.      * @ORM\JoinColumn(nullable=false)
  46.      */
  47.     private $group;
  48.     /**
  49.      * @Groups({"categorylist", "video_search", "imageset_search"})
  50.      *
  51.      * @ORM\Column(type="integer")
  52.      */
  53.     private $sorting 0;
  54.     /**
  55.      * @Groups({"categorylist"})
  56.      *
  57.      * @ORM\Column(type="string", length=100, unique=true, nullable=true)
  58.      */
  59.     private $filename;
  60.     /**
  61.      * @Groups({"categorylist"})
  62.      */
  63.     private ?string $imageUrl null;
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getName(): ?string
  69.     {
  70.         return $this->name;
  71.     }
  72.     public function setName(string $name): self
  73.     {
  74.         $this->name $name;
  75.         return $this;
  76.     }
  77.     public function getVideoSlug(): ?string
  78.     {
  79.         return $this->videoSlug;
  80.     }
  81.     public function setVideoSlug(string $videoSlug): self
  82.     {
  83.         $this->videoSlug $videoSlug;
  84.         return $this;
  85.     }
  86.     public function getImagesetSlug(): ?string
  87.     {
  88.         return $this->imagesetSlug;
  89.     }
  90.     public function setImagesetSlug(string $imagesetSlug): self
  91.     {
  92.         $this->imagesetSlug $imagesetSlug;
  93.         return $this;
  94.     }
  95.     public function getGroup(): ?CategoryGroup
  96.     {
  97.         return $this->group;
  98.     }
  99.     public function setGroup(CategoryGroup $group): self
  100.     {
  101.         $this->group $group;
  102.         return $this;
  103.     }
  104.     public function getSorting(): int
  105.     {
  106.         return $this->sorting;
  107.     }
  108.     public function setSorting(int $sorting): self
  109.     {
  110.         $this->sorting $sorting;
  111.         return $this;
  112.     }
  113.     public function getFilename(): ?string
  114.     {
  115.         return $this->filename;
  116.     }
  117.     public function setFilename(string $filename): self
  118.     {
  119.         $this->filename $filename;
  120.         return $this;
  121.     }
  122.     public function setImageUrl(string $url): self
  123.     {
  124.         $this->imageUrl $url;
  125.         return $this;
  126.     }
  127.     public function getImageUrl(): ?string
  128.     {
  129.         return $this->imageUrl;
  130.     }
  131. }