src/NoteBundle/Form/Model/AppelModel.php line 92

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 AppelModel 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.      * @return GroupStudent
  24.      */
  25.     public function getGroup(): ?GroupStudent
  26.     {
  27.         return $this->group;
  28.     }
  29.     /**
  30.      * @param GroupStudent $group
  31.      * @return AppelModel
  32.      */
  33.     public function setGroup(GroupStudent $group): AppelModel
  34.     {
  35.         $this->group $group;
  36.         return $this;
  37.     }
  38.     /**
  39.      * @return Branche
  40.      */
  41.     public function getBranche(): ?Branche
  42.     {
  43.         return $this->branche;
  44.     }
  45.     /**
  46.      * @param Branche $branche
  47.      * @return AppelModel
  48.      */
  49.     public function setBranche(Branche $branche): AppelModel
  50.     {
  51.         $this->branche $branche;
  52.         return $this;
  53.     }
  54.     /**
  55.      * @return Secteur
  56.      */
  57.     public function getSecteur(): ?Secteur
  58.     {
  59.         return $this->secteur;
  60.     }
  61.     /**
  62.      * @param Secteur $secteur
  63.      * @return AppelModel
  64.      */
  65.     public function setSecteur(Secteur $secteur): AppelModel
  66.     {
  67.         $this->secteur $secteur;
  68.         return $this;
  69.     }
  70.     /**
  71.      * Specify data which should be serialized to JSON
  72.      * @link https://php.net/manual/en/jsonserializable.jsonserialize.php
  73.      * @return mixed data which can be serialized by <b>json_encode</b>,
  74.      * which is a value of any type other than a resource.
  75.      * @since 5.4.0
  76.      */
  77.     public function jsonSerialize()
  78.     {
  79.         return [
  80.             'branche' => $this->branche->getId(),
  81.             'secteur' => (null !== $this->secteur) ? $this->secteur->getId() : null,
  82.             'group' => (null !== $this->group) ? $this->group->getId() : null
  83.         ];
  84.     }
  85. }