src/Entity/Olympiad/Category.php line 16

  1. <?php
  2. namespace App\Entity\Olympiad;
  3. use App\Entity\Traits\ActiveTrait;
  4. use App\Entity\Traits\CreatedTrait;
  5. use App\Entity\Traits\DeletedTrait;
  6. use App\Entity\Traits\UserCreatedInterface;
  7. use App\Entity\Traits\UserCreatedTrait;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Table(name'olympiad_category')]
  11. #[ORM\Entity(repositoryClass'App\Repository\Olympiad\CategoryRepository')]
  12. #[ORM\HasLifecycleCallbacks]
  13. class Category implements UserCreatedInterface
  14. {
  15.     use ActiveTrait;
  16.     use CreatedTrait;
  17.     use UserCreatedTrait;
  18.     use DeletedTrait;
  19.     /**
  20.      * @var int|null
  21.      */
  22.     #[ORM\Id]
  23.     #[ORM\GeneratedValue(strategy'AUTO')]
  24.     #[ORM\Column(type'integer')]
  25.     private $id;
  26.     /**
  27.      * @var string|null
  28.      */
  29.     #[ORM\Column(type'string')]
  30.     private $caption;
  31.     /**
  32.      * @var string|null
  33.      */
  34.     #[ORM\Column(type'string'length150)]
  35.     private $slug;
  36.     /**
  37.      * @var string|null
  38.      */
  39.     #[ORM\Column(type'string'length150nullabletrue)]
  40.     private $iconClass;
  41.     /**
  42.      * @var Collection|Discipline[]
  43.      */
  44.     #[ORM\OneToMany(targetEntity'App\Entity\Olympiad\Discipline'mappedBy'category')]
  45.     private $disciplines;
  46.     /**
  47.      * @return int|null
  48.      */
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     /**
  54.      * @param int|null $id
  55.      */
  56.     public function setId(?int $id): void
  57.     {
  58.         $this->id $id;
  59.     }
  60.     /**
  61.      * @return string|null
  62.      */
  63.     public function getCaption(): ?string
  64.     {
  65.         return $this->caption;
  66.     }
  67.     /**
  68.      * @param string|null $caption
  69.      */
  70.     public function setCaption(?string $caption): void
  71.     {
  72.         $this->caption $caption;
  73.     }
  74.     /**
  75.      * @return Discipline[]|Collection
  76.      */
  77.     public function getDisciplines()
  78.     {
  79.         return $this->disciplines;
  80.     }
  81.     /**
  82.      * @param Discipline[]|Collection $disciplines
  83.      */
  84.     public function setDisciplines($disciplines): void
  85.     {
  86.         $this->disciplines $disciplines;
  87.     }
  88.     /**
  89.      * @return string|null
  90.      */
  91.     public function getSlug(): ?string
  92.     {
  93.         return $this->slug;
  94.     }
  95.     /**
  96.      * @param string|null $slug
  97.      */
  98.     public function setSlug(?string $slug): void
  99.     {
  100.         $this->slug $slug;
  101.     }
  102.     /**
  103.      * @return string|null
  104.      */
  105.     public function getIconClass(): ?string
  106.     {
  107.         return $this->iconClass;
  108.     }
  109.     /**
  110.      * @param string|null $iconClass
  111.      */
  112.     public function setIconClass(?string $iconClass): void
  113.     {
  114.         $this->iconClass $iconClass;
  115.     }
  116. }