src/Sulu/Bundle/SecurityBundle/Controller/RoleController.php
public function deleteAction($id)
    {
        $delete = function($id) {
            $role = $this->getRoleRepository()->findRoleById($id);

            if (!$role) {
                throw new EntityNotFoundException($this->getRoleRepository()->getClassName(), $id);
            }

            $em = $this->getDoctrine()->getManager();
            $em->remove($role);
            $em->flush();
        };

        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
public function deleteAction($id)
    {
        $delete = function($id) {
            $role = $this->getRoleRepository()->findRoleById($id);

            if (!$role) {
                throw new EntityNotFoundException($this->getRoleRepository()->getClassName(), $id);
            }

            $em = $this->getDoctrine()->getManager();
            $em->remove($role);
            $em->flush();
        };

        $view = $this->responseDelete($id, $delete);

        return $this->handleView($view);
    }
public function deleteAction ( $ id ) { $ delete = function ( $ id ) { $ role = $ this -> getRoleRepository ( ) -> findRoleById ( $ id ) ; if ( ! $ role ) { throw new EntityNotFoundException ( $ this -> getRoleRepository ( ) -> getClassName ( ) , $ id ) ; } $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> remove ( $ role ) ; $ em -> flush ( ) ; } ; $ view = $ this -> responseDelete ( $ id , $ delete ) ; return $ this -> handleView ( $ view ) ; }
Deletes the role with the given id.

@param $id

@return \Symfony\Component\HttpFoundation\Response
Deletes the role with the given id .