original_string: public function deleteAction(Module $entity)
      {
          $acl = $this->get('bacon_acl.service.authorization');
  
          if (!$acl->authorize('module', 'DELETE')) {
              throw $this->createAccessDeniedException();
          }
  
          $handler = new ModuleFormHandler(
              $this->createDeleteForm('module_delete', $entity),
              $this->get('doctrine')->getManager(),
              $this->get('session')->getFlashBag()
          );
  
          $handler->delete($entity);
  
          return $this->redirect($this->generateUrl('module'));
      }
code: public function deleteAction(Module $entity)
      {
          $acl = $this->get('bacon_acl.service.authorization');
  
          if (!$acl->authorize('module', 'DELETE')) {
              throw $this->createAccessDeniedException();
          }
  
          $handler = new ModuleFormHandler(
              $this->createDeleteForm('module_delete', $entity),
              $this->get('doctrine')->getManager(),
              $this->get('session')->getFlashBag()
          );
  
          $handler->delete($entity);
  
          return $this->redirect($this->generateUrl('module'));
      }
code_tokens: public function deleteAction ( Module $ entity ) { $ acl = $ this -> get ( 'bacon_acl.service.authorization' ) ; if ( ! $ acl -> authorize ( 'module' , 'DELETE' ) ) { throw $ this -> createAccessDeniedException ( ) ; } $ handler = new ModuleFormHandler ( $ this -> createDeleteForm ( 'module_delete' , $ entity ) , $ this -> get ( 'doctrine' ) -> getManager ( ) , $ this -> get ( 'session' ) -> getFlashBag ( ) ) ; $ handler -> delete ( $ entity ) ; return $ this -> redirect ( $ this -> generateUrl ( 'module' ) ) ; }
docstring: Deletes a Module entity.
  
  @Route("/{id}", name="module_delete")
  @Security("has_role('ROLE_ADMIN')")
  @Method("DELETE")
docstring_tokens: Deletes a Module entity .