src/Entity/RookieDaySchool.php line 8

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. class RookieDaySchool {
  6.     /**
  7.      * @var int
  8.      */
  9.     private $id;
  10.     /**
  11.      * @var string
  12.      */
  13.     private $schoolName;
  14.     /**
  15.      * @var \DateTime
  16.      */
  17.     private $createdAt;
  18.     /**
  19.      * @var \App\Entity\RookieDayDistrict
  20.      */
  21.     private $district;
  22.     /**
  23.      * @var \Doctrine\Common\Collections\Collection
  24.      */
  25.     private $dateMappings;
  26.     /**
  27.      * Constructor
  28.      */
  29.     public function __construct() {
  30.         $this->dateMappings = new ArrayCollection();
  31.     }
  32.     /**
  33.      * Get id.
  34.      *
  35.      * @return int
  36.      */
  37.     public function getId() {
  38.         return $this->id;
  39.     }
  40.     /**
  41.      * Set schoolName.
  42.      *
  43.      * @param string $schoolName
  44.      *
  45.      * @return RookieDaySchool
  46.      */
  47.     public function setSchoolName($schoolName) {
  48.         $this->schoolName $schoolName;
  49.         return $this;
  50.     }
  51.     /**
  52.      * Get schoolName.
  53.      *
  54.      * @return string
  55.      */
  56.     public function getSchoolName() {
  57.         return $this->schoolName;
  58.     }
  59.     public function getDistrict(): \App\Entity\RookieDayDistrict {
  60.         return $this->district;
  61.     }
  62.     public function setDistrict(\App\Entity\RookieDayDistrict $district): void {
  63.         $this->district $district;
  64.     }
  65.     /**
  66.      * Add dateMapping.
  67.      *
  68.      * @param \App\Entity\RookieDaySchoolDateMapping $dateMapping
  69.      *
  70.      * @return RookieDaySchool
  71.      */
  72.     public function addDateMapping(\App\Entity\RookieDaySchoolDateMapping $dateMapping) {
  73.         $this->dateMappings[] = $dateMapping;
  74.         return $this;
  75.     }
  76.     /**
  77.      * Remove dateMapping.
  78.      *
  79.      * @param \App\Entity\RookieDaySchoolDateMapping $dateMapping
  80.      *
  81.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  82.      */
  83.     public function removeDateMapping(\App\Entity\RookieDaySchoolDateMapping $dateMapping) {
  84.         return $this->dateMappings->removeElement($dateMapping);
  85.     }
  86.     /**
  87.      * Get dateMappings.
  88.      *
  89.      * @return \Doctrine\Common\Collections\Collection
  90.      */
  91.     public function getDateMappings() {
  92.         return $this->dateMappings;
  93.     }
  94.     /**
  95.      * Set createdAt.
  96.      *
  97.      * @param \DateTime $createdAt
  98.      *
  99.      * @return RookieDayCompany
  100.      */
  101.     public function setCreatedAt($createdAt) {
  102.         $this->createdAt $createdAt;
  103.         return $this;
  104.     }
  105.     /**
  106.      * Get createdAt.
  107.      *
  108.      * @return \DateTime
  109.      */
  110.     public function getCreatedAt() {
  111.         return $this->createdAt;
  112.     }
  113.     public function getDateString() {
  114.         $strDate "";
  115.         /* @var $dateMapping \App\Entity\RookieDaySchoolDateMapping */
  116.         foreach ($this->dateMappings as $dateMapping) {
  117.             $eventDate $dateMapping->getEventDate();
  118.             $strDate $eventDate->getDateString() . ' ';
  119.         }
  120.         return trim($strDate);
  121.     }
  122. }