src/Entity/Organisation/University/University.php line 11

  1. <?php
  2. namespace App\Entity\Organisation\University;
  3. use App\Entity\Organisation\Organisation;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Table(name'universities')]
  7. #[ORM\Entity(repositoryClass'App\Repository\Organisation\University\UniversityRepository')]
  8. class University
  9. {
  10.     /**
  11.      * @var ?int
  12.      */
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue(strategy'AUTO')]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     /**
  18.      * @var ArrayCollection|Category[]
  19.      */
  20.     #[ORM\JoinTable(name'university_category_relation')]
  21.     #[ORM\ManyToMany(targetEntity'App\Entity\Organisation\University\Category'inversedBy'organisations')]
  22.     private $universityCategories;
  23.     #[ORM\Column(type'boolean'options: ['default' => false])]
  24.     private $haveDorm false;
  25.     #[ORM\Column(type'boolean'options: ['default' => false])]
  26.     private $haveMilitaryDepartment false;
  27.     /**
  28.      * @var
  29.      */
  30.     #[ORM\OneToMany(targetEntity'App\Entity\Organisation\University\Specialty'mappedBy'university')]
  31.     private $specialties;
  32.     /**
  33.      * @var Organisation
  34.      */
  35.     #[ORM\OneToOne(targetEntity'App\Entity\Organisation\Organisation')]
  36.     private $organisation;
  37.     public function __construct()
  38.     {
  39.         $this->universityCategories = new ArrayCollection();
  40.     }
  41.     /**
  42.      * @return Category[]|ArrayCollection
  43.      */
  44.     public function getUniversityCategories()
  45.     {
  46.         return $this->universityCategories;
  47.     }
  48.     /**
  49.      * @param Category[]|ArrayCollection $universityCategories
  50.      */
  51.     public function setUniversityCategories($universityCategories): void
  52.     {
  53.         $this->universityCategories $universityCategories;
  54.     }
  55.     /**
  56.      * @return bool
  57.      */
  58.     public function isHaveDorm(): bool
  59.     {
  60.         return $this->haveDorm;
  61.     }
  62.     /**
  63.      * @param bool $haveDorm
  64.      */
  65.     public function setHaveDorm(bool $haveDorm): void
  66.     {
  67.         $this->haveDorm $haveDorm;
  68.     }
  69.     /**
  70.      * @return bool
  71.      */
  72.     public function isHaveMilitaryDepartment(): bool
  73.     {
  74.         return $this->haveMilitaryDepartment;
  75.     }
  76.     /**
  77.      * @param bool $haveMilitaryDepartment
  78.      */
  79.     public function setHaveMilitaryDepartment(bool $haveMilitaryDepartment): void
  80.     {
  81.         $this->haveMilitaryDepartment $haveMilitaryDepartment;
  82.     }
  83.     /**
  84.      * @return int|null
  85.      */
  86.     public function getId(): ?int
  87.     {
  88.         return $this->id;
  89.     }
  90.     /**
  91.      * @param int|null $id
  92.      */
  93.     public function setId(?int $id): void
  94.     {
  95.         $this->id $id;
  96.     }
  97.     /**
  98.      * @return Organisation
  99.      */
  100.     public function getOrganisation(): Organisation
  101.     {
  102.         return $this->organisation;
  103.     }
  104.     /**
  105.      * @param Organisation $organisation
  106.      */
  107.     public function setOrganisation(Organisation $organisation): void
  108.     {
  109.         $this->organisation $organisation;
  110.     }
  111.     /**
  112.      * @return mixed
  113.      */
  114.     public function getSpecialties()
  115.     {
  116.         return $this->specialties;
  117.     }
  118.     /**
  119.      * @param mixed $specialties
  120.      */
  121.     public function setSpecialties($specialties): void
  122.     {
  123.         $this->specialties $specialties;
  124.     }
  125. }