src/NoteBundle/Form/Model/AbsenceModel.php line 137

Open in your IDE?
  1. <?php
  2. namespace NoteBundle\Form\Model;
  3. use CoreBundle\Entity\Branche;
  4. use CoreBundle\Entity\GroupStudent;
  5. use CoreBundle\Entity\Module;
  6. use CoreBundle\Entity\Periode;
  7. use CoreBundle\Entity\Secteur;
  8. class AbsenceModel implements \JsonSerializable
  9. {
  10.     /**
  11.      * @var Branche
  12.      */
  13.     private $branche;
  14.     /**
  15.      * @var Secteur
  16.      */
  17.     private $secteur;
  18.     /**
  19.      * @var GroupStudent
  20.      */
  21.     private $group;
  22.     /**
  23.      * @var int
  24.      */
  25.     private $month;
  26.     /**
  27.      * @var int
  28.      */
  29.     private $year;
  30.     /**
  31.      * @return GroupStudent
  32.      */
  33.     public function getGroup(): ?GroupStudent
  34.     {
  35.         return $this->group;
  36.     }
  37.     /**
  38.      * @param GroupStudent $group
  39.      * @return AbsenceModel
  40.      */
  41.     public function setGroup(GroupStudent $group): AbsenceModel
  42.     {
  43.         $this->group $group;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return int
  48.      */
  49.     public function getMonth(): int
  50.     {
  51.         return $this->month;
  52.     }
  53.     /**
  54.      * @param int $month
  55.      * @return AbsenceModel
  56.      */
  57.     public function setMonth(int $month): AbsenceModel
  58.     {
  59.         $this->month $month;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return int
  64.      */
  65.     public function getYear(): int
  66.     {
  67.         return $this->year;
  68.     }
  69.     /**
  70.      * @param int $year
  71.      * @return AbsenceModel
  72.      */
  73.     public function setYear(int $year): AbsenceModel
  74.     {
  75.         $this->year $year;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return Branche
  80.      */
  81.     public function getBranche(): ?Branche
  82.     {
  83.         return $this->branche;
  84.     }
  85.     /**
  86.      * @param Branche $branche
  87.      * @return AbsenceModel
  88.      */
  89.     public function setBranche(Branche $branche): AbsenceModel
  90.     {
  91.         $this->branche $branche;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Secteur
  96.      */
  97.     public function getSecteur(): ?Secteur
  98.     {
  99.         return $this->secteur;
  100.     }
  101.     /**
  102.      * @param Secteur $secteur
  103.      * @return AbsenceModel
  104.      */
  105.     public function setSecteur(Secteur $secteur): AbsenceModel
  106.     {
  107.         $this->secteur $secteur;
  108.         return $this;
  109.     }
  110.     /**
  111.      * Specify data which should be serialized to JSON
  112.      * @link https://php.net/manual/en/jsonserializable.jsonserialize.php
  113.      * @return mixed data which can be serialized by <b>json_encode</b>,
  114.      * which is a value of any type other than a resource.
  115.      * @since 5.4.0
  116.      */
  117.     public function jsonSerialize()
  118.     {
  119.         return [
  120.             'branche' => $this->branche->getId(),
  121.             'secteur' => (null !== $this->secteur) ? $this->secteur->getId() : null,
  122.             'month' => $this->month,
  123.             'year' => $this->year,
  124.             'group' => (null !== $this->group) ? $this->group->getId() : null
  125.         ];
  126.     }
  127. }