src/NoteBundle/Form/Model/ExportModel.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 ExportModel implements \JsonSerializable
  9. {
  10.     /**
  11.      * @var Branche
  12.      */
  13.     private $branche;
  14.     /**
  15.      * @var Periode
  16.      */
  17.     private $periode;
  18.     /**
  19.      * @var int
  20.      */
  21.     private $quad;
  22.     /**
  23.      * @var \DateTime
  24.      */
  25.     private $dateFrom;
  26.     /**
  27.      * @var \DateTime
  28.      */
  29.     private $dateTo;
  30.     /**
  31.      * @return Periode
  32.      */
  33.     public function getPeriode()
  34.     {
  35.         return $this->periode;
  36.     }
  37.     /**
  38.      * @param Periode $periode
  39.      * @return ExportModel
  40.      */
  41.     public function setPeriode(Periode $periode): self
  42.     {
  43.         $this->periode $periode;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return \DateTime
  48.      */
  49.     public function getDateFrom()
  50.     {
  51.         return $this->dateFrom;
  52.     }
  53.     /**
  54.      * @param \DateTime $dateFrom
  55.      * @return ExportModel
  56.      */
  57.     public function setDateFrom(\DateTime $dateFrom): self
  58.     {
  59.         $this->dateFrom $dateFrom;
  60.         return $this;
  61.     }
  62.     /**
  63.      * @return \DateTime
  64.      */
  65.     public function getDateTo()
  66.     {
  67.         return $this->dateTo;
  68.     }
  69.     /**
  70.      * @param \DateTime $dateTo
  71.      * @return ExportModel
  72.      */
  73.     public function setDateTo(\DateTime $dateTo): self
  74.     {
  75.         $this->dateTo $dateTo;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return int
  80.      */
  81.     public function getQuad()
  82.     {
  83.         return $this->quad;
  84.     }
  85.     /**
  86.      * @param int $quad
  87.      * @return ExportModel
  88.      */
  89.     public function setQuad(int $quad): self
  90.     {
  91.         $this->quad $quad;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Branche
  96.      */
  97.     public function getBranche(): ?Branche
  98.     {
  99.         return $this->branche;
  100.     }
  101.     /**
  102.      * @param Branche $branche
  103.      * @return ExportModel
  104.      */
  105.     public function setBranche(Branche $branche): self
  106.     {
  107.         $this->branche $branche;
  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.             'periode' => $this->periode->getId(),
  122.             'quad' => $this->quad,
  123.             'from' => $this->dateFrom->format('Y-m-d'),
  124.             'to' => $this->dateTo->format('Y-m-d')
  125.         ];
  126.     }
  127. }