Controller/Backend/LanguageController.php
public function deleteAction(Request $request, $id)
    {

        $handler = new LanguageFormHandler(
            $this->createDeleteForm(),
            $request,
            $this->get('doctrine')->getManager(),
            $this->get('session')->getFlashBag()
        );


        $entity = $this->getDoctrine()->getRepository('BaconLanguageBundle:Language')->find($id);

        if ($handler->delete($entity)) {
            return $this->redirect($this->generateUrl('admin_language'));
        }

        return $this->redirect($this->generateUrl('admin_language_show', array('id' => $id)));
    }
public function deleteAction(Request $request, $id)
    {

        $handler = new LanguageFormHandler(
            $this->createDeleteForm(),
            $request,
            $this->get('doctrine')->getManager(),
            $this->get('session')->getFlashBag()
        );


        $entity = $this->getDoctrine()->getRepository('BaconLanguageBundle:Language')->find($id);

        if ($handler->delete($entity)) {
            return $this->redirect($this->generateUrl('admin_language'));
        }

        return $this->redirect($this->generateUrl('admin_language_show', array('id' => $id)));
    }
public function deleteAction ( Request $ request , $ id ) { $ handler = new LanguageFormHandler ( $ this -> createDeleteForm ( ) , $ request , $ this -> get ( 'doctrine' ) -> getManager ( ) , $ this -> get ( 'session' ) -> getFlashBag ( ) ) ; $ entity = $ this -> getDoctrine ( ) -> getRepository ( 'BaconLanguageBundle:Language' ) -> find ( $ id ) ; if ( $ handler -> delete ( $ entity ) ) { return $ this -> redirect ( $ this -> generateUrl ( 'admin_language' ) ) ; } return $ this -> redirect ( $ this -> generateUrl ( 'admin_language_show' , array ( 'id' => $ id ) ) ) ; }
Deletes a Language entity.

@Route("/{id}", name="admin_language_delete")
@Security("has_role('ROLE_ADMIN')")
@Method("DELETE")
Deletes a Language entity .