Exemple #1
0
 public function saveExamen(Examen $_examen)
 {
     $exam = array('examen_name' => $_examen->getExamenName(), 'coeff_examen' => $_examen->getCoeffExamen(), 'date' => $_examen->getDateExamen(), 'description' => $_examen->getDescriptionExamen(), 'semestre' => $_examen->getSemestre(), 'notation' => $_examen->getNotation(), 'id_class' => $_examen->getClass()->getIdClassName(), 'id_discipline' => $_examen->getDiscipline()->getIdDiscipline(), 'dt_create' => $_examen->getDtCreate(), 'dt_update' => $_examen->getDtUpdate());
     //on modifie
     if ($_examen->getIdExamen()) {
         $this->getDb()->update('examen', $exam, array('id_examen' => $_examen->getIdExamen()));
     } else {
         $this->getDb()->insert('examen', $exam);
         //   $_id_examen = $this->getDb()->lastInsertId();
         //   $_examen->setIdExamen($_id_examen);
     }
 }