src/Entity/Olympiad/Discipline.php line 17

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