/** * Save data. * * @param Request $request * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function saveAction(Request $request) { $this->check(); $data = $request->request->all(); $disease = new Disease(); if (empty($data['id'])) { unset($data['id']); } else { $disease->load($data['id']); } $disease->setData($data); $disease->save(); return $this->redirectToRoute('disease_homepage', array('id' => $disease->getId())); }