public function updateRoleDraft($roleId, Request $request)
    {
        $createStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        try {
            // First try to load the draft for given role.
            $roleDraft = $this->roleService->loadRoleDraftByRoleId($roleId);
        } catch (NotFoundException $e) {
            // We might want a newly created role, so try to load it by its ID.
            // loadRoleDraft() might throw a NotFoundException (wrong $roleId). If so, let it bubble up.
            $roleDraft = $this->roleService->loadRoleDraft($roleId);
        }

        return $this->roleService->updateRoleDraft($roleDraft, $this->mapToUpdateStruct($createStruct));
    }
public function updateRoleDraft($roleId, Request $request)
    {
        $createStruct = $this->inputDispatcher->parse(
            new Message(
                array('Content-Type' => $request->headers->get('Content-Type')),
                $request->getContent()
            )
        );

        try {
            // First try to load the draft for given role.
            $roleDraft = $this->roleService->loadRoleDraftByRoleId($roleId);
        } catch (NotFoundException $e) {
            // We might want a newly created role, so try to load it by its ID.
            // loadRoleDraft() might throw a NotFoundException (wrong $roleId). If so, let it bubble up.
            $roleDraft = $this->roleService->loadRoleDraft($roleId);
        }

        return $this->roleService->updateRoleDraft($roleDraft, $this->mapToUpdateStruct($createStruct));
    }
public function updateRoleDraft ( $ roleId , Request $ request ) { $ createStruct = $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ; try { // First try to load the draft for given role. $ roleDraft = $ this -> roleService -> loadRoleDraftByRoleId ( $ roleId ) ; } catch ( NotFoundException $ e ) { // We might want a newly created role, so try to load it by its ID. // loadRoleDraft() might throw a NotFoundException (wrong $roleId). If so, let it bubble up. $ roleDraft = $ this -> roleService -> loadRoleDraft ( $ roleId ) ; } return $ this -> roleService -> updateRoleDraft ( $ roleDraft , $ this -> mapToUpdateStruct ( $ createStruct ) ) ; }
Updates a role draft.

@param mixed $roleId Original role ID, or ID of the role draft itself

@return \eZ\Publish\API\Repository\Values\User\RoleDraft
Updates a role draft .