<?php
namespace NoteBundle\Form\Model;
use CoreBundle\Entity\Branche;
use CoreBundle\Entity\GroupStudent;
use CoreBundle\Entity\Module;
use CoreBundle\Entity\Periode;
use CoreBundle\Entity\Secteur;
class ExportModel implements \JsonSerializable
{
/**
* @var Branche
*/
private $branche;
/**
* @var Periode
*/
private $periode;
/**
* @var int
*/
private $quad;
/**
* @var \DateTime
*/
private $dateFrom;
/**
* @var \DateTime
*/
private $dateTo;
/**
* @return Periode
*/
public function getPeriode()
{
return $this->periode;
}
/**
* @param Periode $periode
* @return ExportModel
*/
public function setPeriode(Periode $periode): self
{
$this->periode = $periode;
return $this;
}
/**
* @return \DateTime
*/
public function getDateFrom()
{
return $this->dateFrom;
}
/**
* @param \DateTime $dateFrom
* @return ExportModel
*/
public function setDateFrom(\DateTime $dateFrom): self
{
$this->dateFrom = $dateFrom;
return $this;
}
/**
* @return \DateTime
*/
public function getDateTo()
{
return $this->dateTo;
}
/**
* @param \DateTime $dateTo
* @return ExportModel
*/
public function setDateTo(\DateTime $dateTo): self
{
$this->dateTo = $dateTo;
return $this;
}
/**
* @return int
*/
public function getQuad()
{
return $this->quad;
}
/**
* @param int $quad
* @return ExportModel
*/
public function setQuad(int $quad): self
{
$this->quad = $quad;
return $this;
}
/**
* @return Branche
*/
public function getBranche(): ?Branche
{
return $this->branche;
}
/**
* @param Branche $branche
* @return ExportModel
*/
public function setBranche(Branche $branche): self
{
$this->branche = $branche;
return $this;
}
/**
* Specify data which should be serialized to JSON
* @link https://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
*/
public function jsonSerialize()
{
return [
'branche' => $this->branche->getId(),
'periode' => $this->periode->getId(),
'quad' => $this->quad,
'from' => $this->dateFrom->format('Y-m-d'),
'to' => $this->dateTo->format('Y-m-d')
];
}
}