Ejemplo n.º 1
0
 /**
  * Instantiates a conge entity and sets its properties using db data.
  *
  * @param array $congeData
  *   The array of db data.
  *
  * @return App\Model\Entity\Conge
  */
 protected function buildConge($congeData)
 {
     $conge = new Conge();
     $conge->setDateDebut($congeData['date_debut']);
     $conge->setDateFin($congeData['date_fin']);
     $conge->setCommentaire($congeData['commentaire']);
     $conge->setStatut($congeData['statut']);
     // pass though temporary class to get values as we have set property as private
     $temp = new \stdClass();
     $temp->date_debut = $conge->getDateDebut();
     $temp->date_fin = $conge->getDateDebut();
     $temp->statut = $conge->getStatutText();
     $temp->commentaire = $conge->getCommentaire();
     return $temp;
 }