public function deleteDisciplineAction(Request $request, Application $app) { $id_discipline = $request->request->get('id_discipline'); $newDiscipline = new Discipline(); $newDiscipline->setIdDiscipline($id_discipline); $app['dao.discipline']->deleteDiscipline($newDiscipline->getIdDiscipline()); $app['session']->getFlashBag()->add('danger', 'Matière supprimée !'); return $app->redirect($app['url_generator']->generate('disciplineslist')); }
/** * @param $row * @return Discipline * * Construction de l'objet Discipline, la matière */ protected function buildDomainObject($row) { $discipline = new Discipline(); $discipline->setIdDiscipline($row['id_discipline']); $discipline->setNameDiscipline($row['name_discipline']); $discipline->setDescription($row['description']); $discipline->setDtCreate($row['dt_create']); $discipline->setDtUpdate($row['dt_update']); return $discipline; }