diff --git a/Controller/ReportController.php b/Controller/ReportController.php index 37a832acb..ef5596b4b 100644 --- a/Controller/ReportController.php +++ b/Controller/ReportController.php @@ -194,12 +194,9 @@ class ReportController extends Controller throw $this->createNotFoundException('Unable to find Report entity.'); } - //$deleteForm = $this->createDeleteForm($id); - return $this->render('ChillReportBundle:Report:show.html.twig', array( 'entity' => $entity, 'person' => $person, - //'delete_form' => $deleteForm->createView(), )); } @@ -276,44 +273,4 @@ class ReportController extends Controller 'delete_form' => $deleteForm->createView(), )); } - /** - * Deletes a Report entity. - * - */ - public function deleteAction(Request $request, $id) - { - $form = $this->createDeleteForm($id); - $form->handleRequest($request); - - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillReportBundle:Report')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find Report entity.'); - } - - $em->remove($entity); - $em->flush(); - } - - return $this->redirect($this->generateUrl('report')); - } - - /** - * Creates a form to delete a Report entity by id. - * - * @param mixed $id The entity id - * - * @return \Symfony\Component\Form\Form The form - */ - private function createDeleteForm($id) - { - return $this->createFormBuilder() - ->setAction($this->generateUrl('report_delete', array('id' => $id))) - ->setMethod('DELETE') - ->add('submit', 'submit', array('label' => 'Delete')) - ->getForm() - ; - } }