Controller/PermissionsGroupController.php
public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);

        if (!$permissionsGroup) {
            throw $this->createNotFoundException('Unable to find PermissionsGroup entity.');
        }

        $editForm = $this->createEditForm($permissionsGroup);
        
        $deleteRoleScopesForm = array();
        foreach ($permissionsGroup->getRoleScopes() as $roleScope) {
            $deleteRoleScopesForm[$roleScope->getId()] = $this->createDeleteRoleScopeForm(
                    $permissionsGroup, $roleScope);
        }
        
        $addRoleScopesForm = $this->createAddRoleScopeForm($permissionsGroup);

        return $this->render('ChillMainBundle:PermissionsGroup:edit.html.twig', array(
            'entity'      => $permissionsGroup,
            'edit_form'   => $editForm->createView(),
            'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()),
            'delete_role_scopes_form' => array_map( function($form) { 
                
                return $form->createView(); 
            }, $deleteRoleScopesForm),
            'add_role_scopes_form' => $addRoleScopesForm->createView()
        ));
    }
public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $permissionsGroup = $em->getRepository('ChillMainBundle:PermissionsGroup')->find($id);

        if (!$permissionsGroup) {
            throw $this->createNotFoundException('Unable to find PermissionsGroup entity.');
        }

        $editForm = $this->createEditForm($permissionsGroup);
        
        $deleteRoleScopesForm = array();
        foreach ($permissionsGroup->getRoleScopes() as $roleScope) {
            $deleteRoleScopesForm[$roleScope->getId()] = $this->createDeleteRoleScopeForm(
                    $permissionsGroup, $roleScope);
        }
        
        $addRoleScopesForm = $this->createAddRoleScopeForm($permissionsGroup);

        return $this->render('ChillMainBundle:PermissionsGroup:edit.html.twig', array(
            'entity'      => $permissionsGroup,
            'edit_form'   => $editForm->createView(),
            'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()),
            'delete_role_scopes_form' => array_map( function($form) { 
                
                return $form->createView(); 
            }, $deleteRoleScopesForm),
            'add_role_scopes_form' => $addRoleScopesForm->createView()
        ));
    }
public function editAction ( $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ permissionsGroup = $ em -> getRepository ( 'ChillMainBundle:PermissionsGroup' ) -> find ( $ id ) ; if ( ! $ permissionsGroup ) { throw $ this -> createNotFoundException ( 'Unable to find PermissionsGroup entity.' ) ; } $ editForm = $ this -> createEditForm ( $ permissionsGroup ) ; $ deleteRoleScopesForm = array ( ) ; foreach ( $ permissionsGroup -> getRoleScopes ( ) as $ roleScope ) { $ deleteRoleScopesForm [ $ roleScope -> getId ( ) ] = $ this -> createDeleteRoleScopeForm ( $ permissionsGroup , $ roleScope ) ; } $ addRoleScopesForm = $ this -> createAddRoleScopeForm ( $ permissionsGroup ) ; return $ this -> render ( 'ChillMainBundle:PermissionsGroup:edit.html.twig' , array ( 'entity' => $ permissionsGroup , 'edit_form' => $ editForm -> createView ( ) , 'expanded_roles' => $ this -> getExpandedRoles ( $ permissionsGroup -> getRoleScopes ( ) -> toArray ( ) ) , 'delete_role_scopes_form' => array_map ( function ( $ form ) { return $ form -> createView ( ) ; } , $ deleteRoleScopesForm ) , 'add_role_scopes_form' => $ addRoleScopesForm -> createView ( ) ) ) ; }
Displays a form to edit an existing PermissionsGroup entity.
Displays a form to edit an existing PermissionsGroup entity .