From 41c47df0c363daad2a4562894fe869ac01b848ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 7 Nov 2015 09:56:28 +0100 Subject: [PATCH] remove delete action and form --- Controller/CustomFieldsGroupController.php | 47 +--------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/Controller/CustomFieldsGroupController.php b/Controller/CustomFieldsGroupController.php index 9e0794d73..211d7494a 100644 --- a/Controller/CustomFieldsGroupController.php +++ b/Controller/CustomFieldsGroupController.php @@ -175,12 +175,10 @@ class CustomFieldsGroupController extends Controller } $editForm = $this->createEditForm($entity); - $deleteForm = $this->createDeleteForm($id); return $this->render('ChillCustomFieldsBundle:CustomFieldsGroup:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), )); } @@ -246,7 +244,6 @@ class CustomFieldsGroupController extends Controller throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); } - $deleteForm = $this->createDeleteForm($id); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); @@ -259,49 +256,9 @@ class CustomFieldsGroupController extends Controller return $this->render('ChillCustomFieldsBundle:CustomFieldsGroup:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), - 'delete_form' => $deleteForm->createView(), )); } - /** - * Deletes a CustomFieldsGroup entity. - * - */ - public function deleteAction(Request $request, $id) - { - $form = $this->createDeleteForm($id); - $form->handleRequest($request); - - if ($form->isValid()) { - $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository('ChillCustomFieldsBundle:CustomFieldsGroup')->find($id); - - if (!$entity) { - throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); - } - - $em->remove($entity); - $em->flush(); - } - - return $this->redirect($this->generateUrl('customfieldsgroup')); - } - - /** - * Creates a form to delete a CustomFieldsGroup 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('customfieldsgroup_delete', array('id' => $id))) - ->setMethod('DELETE') - ->add('submit', 'submit', array('label' => 'Delete')) - ->getForm() - ; - } + /** * This function render the customFieldsGroup as a form. @@ -341,7 +298,7 @@ class CustomFieldsGroupController extends Controller } var_dump($form->getData()); - var_dump(json_encode($form->getData())); + var_dump(json_enccode($form->getData())); }