public function loadUserGroupsAssignedToRole($roleId)
    {
        $role = $this->roleService->loadRole($roleId);
        $roleAssignments = $this->roleService->getRoleAssignments($role);

        $restUserGroups = array();

        foreach ($roleAssignments as $roleAssignment) {
            if ($roleAssignment instanceof UserGroupRoleAssignment) {
                $userGroup = $roleAssignment->getUserGroup();
                $userGroupContentInfo = $userGroup->getVersionInfo()->getContentInfo();
                $userGroupLocation = $this->locationService->loadLocation($userGroupContentInfo->mainLocationId);
                $contentType = $this->contentTypeService->loadContentType($userGroupContentInfo->contentTypeId);

                $restUserGroups[] = new Values\RestUserGroup(
                    $userGroup,
                    $contentType,
                    $userGroupContentInfo,
                    $userGroupLocation,
                    $this->contentService->loadRelations($userGroup->getVersionInfo())
                );
            }
        }

        return $restUserGroups;
    }
public function loadUserGroupsAssignedToRole($roleId)
    {
        $role = $this->roleService->loadRole($roleId);
        $roleAssignments = $this->roleService->getRoleAssignments($role);

        $restUserGroups = array();

        foreach ($roleAssignments as $roleAssignment) {
            if ($roleAssignment instanceof UserGroupRoleAssignment) {
                $userGroup = $roleAssignment->getUserGroup();
                $userGroupContentInfo = $userGroup->getVersionInfo()->getContentInfo();
                $userGroupLocation = $this->locationService->loadLocation($userGroupContentInfo->mainLocationId);
                $contentType = $this->contentTypeService->loadContentType($userGroupContentInfo->contentTypeId);

                $restUserGroups[] = new Values\RestUserGroup(
                    $userGroup,
                    $contentType,
                    $userGroupContentInfo,
                    $userGroupLocation,
                    $this->contentService->loadRelations($userGroup->getVersionInfo())
                );
            }
        }

        return $restUserGroups;
    }
public function loadUserGroupsAssignedToRole ( $ roleId ) { $ role = $ this -> roleService -> loadRole ( $ roleId ) ; $ roleAssignments = $ this -> roleService -> getRoleAssignments ( $ role ) ; $ restUserGroups = array ( ) ; foreach ( $ roleAssignments as $ roleAssignment ) { if ( $ roleAssignment instanceof UserGroupRoleAssignment ) { $ userGroup = $ roleAssignment -> getUserGroup ( ) ; $ userGroupContentInfo = $ userGroup -> getVersionInfo ( ) -> getContentInfo ( ) ; $ userGroupLocation = $ this -> locationService -> loadLocation ( $ userGroupContentInfo -> mainLocationId ) ; $ contentType = $ this -> contentTypeService -> loadContentType ( $ userGroupContentInfo -> contentTypeId ) ; $ restUserGroups [ ] = new Values \ RestUserGroup ( $ userGroup , $ contentType , $ userGroupContentInfo , $ userGroupLocation , $ this -> contentService -> loadRelations ( $ userGroup -> getVersionInfo ( ) ) ) ; } } return $ restUserGroups ; }
Loads a list of user groups assigned to role.

@param mixed $roleId

@return \eZ\Publish\Core\REST\Server\Values\RestUserGroup[]
Loads a list of user groups assigned to role .