public function deleteStudentAction(Request $request, Application $app)
 {
     $id_student = $request->request->get('id_student');
     $newStudent = new Student();
     $newStudent->setIdStudent($id_student);
     $app['dao.student']->deleteStudent($newStudent->getIdStudent());
     return $this::deleteStudentIndexAction($request, $app);
 }
Exemple #2
0
 /**
  * @param $row
  * @return Student
  *
  * Construction d'un objet étudiant
  */
 protected function buildDomainObject($row)
 {
     $student = new Student();
     $student->setIdStudent($row['id_student']);
     $student->setName($row['student_name']);
     $student->setFirstname($row['student_firstname']);
     $student->setBirthday($row['student_birthday']);
     $student->setAddress($row['student_address']);
     $student->setEmail($row['student_email']);
     $student->setTel($row['student_tel']);
     $student->setDtCreate($row['dt_create']);
     $student->setDtUpdate($row['dt_update']);
     $classNameID = $row['id_class'];
     if ($classNameID) {
         $classname = $this->classDAO->findClassname($classNameID);
         $student->setClass($classname);
     }
     if (array_key_exists('id_statut', $row)) {
         $statutID = $row['id_statut'];
         $statut = $this->statutDAO->findStatut($statutID);
         $student->setStatut($statut);
     }
     return $student;
 }