public function addAction(Request $request, Application $app) { $newStatut = new StatutStudent(); $newStatut->setStatutStudent($request->request->get('statut')); $newStatut->setDtCreate(date('Y-m-d H:i:s')); $newStatut->setDtUpdate(date('Y-m-d H:i:s')); $app['dao.statutStudent']->saveStatutStudent($newStatut); $app['session']->getFlashBag()->add('success', 'Le statut a bien été ajouté !'); //message flash de success return $app['twig']->render('FormTemplate/addstatut.html.twig'); }
/** * @param $row * @return StatutStudent * * Construction de l'objet de statut étudiant */ protected function buildDomainObject($row) { $statutStudent = new StatutStudent(); $statutStudent->setId($row['id_statut']); $statutStudent->setStatutStudent($row['statut_student']); $statutStudent->setDtCreate($row['dt_create']); $statutStudent->setDtUpdate($row['dt_update']); return $statutStudent; }