CoreBundle/Controller/RoleController.php
public function deleteRoleActorAction(Request $request, Role $role, $actor)
    {
        $em = $this->getDoctrine()->getManager();
        $actor = $em->getRepository($this->get('core_manager')->getActorBundleName().':Actor')->findOneById($actor);
        
        $actor->getRolesCollection()->removeElement($role);
       
        $em->flush();
            
        $this->get('session')->getFlashBag()->add('success', 'role.deleted');

        if($request->query->get('redirect')!=''){
            return  $this->redirect($request->query->get('redirect'));
        }
        return $this->redirectToRoute('core_role_index');
    }
public function deleteRoleActorAction(Request $request, Role $role, $actor)
    {
        $em = $this->getDoctrine()->getManager();
        $actor = $em->getRepository($this->get('core_manager')->getActorBundleName().':Actor')->findOneById($actor);
        
        $actor->getRolesCollection()->removeElement($role);
       
        $em->flush();
            
        $this->get('session')->getFlashBag()->add('success', 'role.deleted');

        if($request->query->get('redirect')!=''){
            return  $this->redirect($request->query->get('redirect'));
        }
        return $this->redirectToRoute('core_role_index');
    }
public function deleteRoleActorAction ( Request $ request , Role $ role , $ actor ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ actor = $ em -> getRepository ( $ this -> get ( 'core_manager' ) -> getActorBundleName ( ) . ':Actor' ) -> findOneById ( $ actor ) ; $ actor -> getRolesCollection ( ) -> removeElement ( $ role ) ; $ em -> flush ( ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'success' , 'role.deleted' ) ; if ( $ request -> query -> get ( 'redirect' ) != '' ) { return $ this -> redirect ( $ request -> query -> get ( 'redirect' ) ) ; } return $ this -> redirectToRoute ( 'core_role_index' ) ; }
Deletes a role entity.

@Route("/{actor}/{role}/delete")
Deletes a role entity .