src/Entity/RookieSchool.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. /**
  4.  * RookieSchool
  5.  */
  6. class RookieSchool {
  7.     /**
  8.      * @var int
  9.      */
  10.     private $id;
  11.     /**
  12.      * @var \App\Entity\School
  13.      */
  14.     private $school;
  15.     /**
  16.      * @var \App\Entity\RookieTimeSlot
  17.      */
  18.     private $timeSlot;
  19.     /**
  20.      * @var string|null
  21.      */
  22.     private $optionalName;
  23.     /**
  24.      * @var string|null
  25.      */
  26.     private $directorMail;
  27.     /**
  28.      * @var \Doctrine\Common\Collections\Collection
  29.      */
  30.     private $schoolClasses;
  31.     /**
  32.      * @var bool
  33.      */
  34.     private $isVisible true;
  35.     /**
  36.      * @var \App\Entity\RookieDistrict
  37.      */
  38.     private $rookieDistrict;
  39.     /**
  40.      * Constructor
  41.      */
  42.     public function __construct() {
  43.         $this->schoolClasses = new \Doctrine\Common\Collections\ArrayCollection();
  44.     }
  45.     /**
  46.      * Get id.
  47.      *
  48.      * @return int
  49.      */
  50.     public function getId() {
  51.         return $this->id;
  52.     }
  53.     /**
  54.      * Set school.
  55.      *
  56.      * @param \App\Entity\School|null $school
  57.      *
  58.      * @return RookieSchool
  59.      */
  60.     public function setSchool(\App\Entity\School $school null) {
  61.         $this->school $school;
  62.         return $this;
  63.     }
  64.     /**
  65.      * Get school.
  66.      *
  67.      * @return \App\Entity\School|null
  68.      */
  69.     public function getSchool() {
  70.         return $this->school;
  71.     }
  72.     /**
  73.      * Set timeSlot.
  74.      *
  75.      * @param \App\Entity\RookieTimeSlot|null $timeSlot
  76.      *
  77.      * @return RookieSchool
  78.      */
  79.     public function setTimeSlot(\App\Entity\RookieTimeSlot $timeSlot null) {
  80.         $this->timeSlot $timeSlot;
  81.         return $this;
  82.     }
  83.     /**
  84.      * Get timeSlot.
  85.      *
  86.      * @return \App\Entity\RookieTimeSlot|null
  87.      */
  88.     public function getTimeSlot() {
  89.         return $this->timeSlot;
  90.     }
  91.     /**
  92.      * Set optionalName.
  93.      *
  94.      * @param string|null $optionalName
  95.      *
  96.      * @return RookieSchool
  97.      */
  98.     public function setOptionalName($optionalName null) {
  99.         $this->optionalName $optionalName;
  100.         return $this;
  101.     }
  102.     /**
  103.      * Get optionalName.
  104.      *
  105.      * @return string|null
  106.      */
  107.     public function getOptionalName() {
  108.         return $this->optionalName;
  109.     }
  110.     /**
  111.      * Set directorEmail.
  112.      *
  113.      * @param string|null $directorMail
  114.      *
  115.      * @return RookieSchool
  116.      */
  117.     public function setDirectorMail($directorMail null) {
  118.         $this->directorMail $directorMail;
  119.         return $this;
  120.     }
  121.     /**
  122.      * Get directorMail.
  123.      *
  124.      * @return string|null
  125.      */
  126.     public function getDirectorMail() {
  127.         return $this->directorMail;
  128.     }
  129.     /**
  130.      * Add schoolClass.
  131.      *
  132.      * @param \App\Entity\RookieSchoolClass $schoolClass
  133.      *
  134.      * @return RookieSchool
  135.      */
  136.     public function addSchoolClass(\App\Entity\RookieSchoolClass $schoolClass) {
  137.         $this->schoolClasses[] = $schoolClass;
  138.         return $this;
  139.     }
  140.     /**
  141.      * Remove schoolClass.
  142.      *
  143.      * @param \App\Entity\RookieSchoolClass $schoolClass
  144.      *
  145.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  146.      */
  147.     public function removeSchoolClass(\App\Entity\RookieSchoolClass $schoolClass) {
  148.         return $this->schoolClasses->removeElement($schoolClass);
  149.     }
  150.     /**
  151.      * Get schoolClasses.
  152.      *
  153.      * @return \Doctrine\Common\Collections\Collection
  154.      */
  155.     public function getSchoolClasses() {
  156.         return $this->schoolClasses;
  157.     }
  158.     /**
  159.      * Set isVisible.
  160.      *
  161.      * @param bool $isVisible
  162.      *
  163.      * @return RookieSchool
  164.      */
  165.     public function setIsVisible($isVisible) {
  166.         $this->isVisible $isVisible;
  167.         return $this;
  168.     }
  169.     /**
  170.      * Get isVisible.
  171.      *
  172.      * @return bool
  173.      */
  174.     public function getIsVisible() {
  175.         return $this->isVisible;
  176.     }
  177.     /**
  178.      * Set rookieDistrict.
  179.      *
  180.      * @param \App\Entity\RookieDistrict|null $rookieDistrict
  181.      *
  182.      * @return RookieSchool
  183.      */
  184.     public function setRookieDistrict(\App\Entity\RookieDistrict $rookieDistrict null) {
  185.         $this->rookieDistrict $rookieDistrict;
  186.         return $this;
  187.     }
  188.     /**
  189.      * Get rookieDistrict.
  190.      *
  191.      * @return \App\Entity\RookieDistrict|null
  192.      */
  193.     public function getRookieDistrict() {
  194.         return $this->rookieDistrict;
  195.     }
  196.     public function getTimeSlotName() {
  197.         if (empty($this->timeSlot)) {
  198.             return "";
  199.         }
  200.         return $this->timeSlot->getName();
  201.     }
  202.     public function getTimeSlotOpenAt() {
  203.         if (empty($this->timeSlot)) {
  204.             return "";
  205.         }
  206.         $openAt $this->timeSlot->getOpenAt();
  207.         return $openAt->format('d.m.Y H:i');
  208.     }
  209.     public function getName() {
  210.         if (!empty($this->optionalName)) {
  211.             return $this->optionalName;
  212.         }
  213.         if (!empty($this->school)) {
  214.             return $this->school->getName();
  215.         }
  216.         return '';
  217.     }
  218. }