eZ\Publish\Core\REST\Server\Controller\User::loadUserGroup PHP Method

loadUserGroup() public method

Loads a user group for the given path.
public loadUserGroup ( $groupPath ) : RestUserGroup
$groupPath
return eZ\Publish\Core\REST\Server\Values\RestUserGroup
    public function loadUserGroup($groupPath)
    {
        $userGroupLocation = $this->locationService->loadLocation($this->extractLocationIdFromPath($groupPath));
        if (trim($userGroupLocation->pathString, '/') != $groupPath) {
            throw new NotFoundException("Could not find location with path string {$groupPath}");
        }
        $userGroup = $this->userService->loadUserGroup($userGroupLocation->contentId);
        $userGroupContentInfo = $userGroup->getVersionInfo()->getContentInfo();
        $contentType = $this->contentTypeService->loadContentType($userGroupContentInfo->contentTypeId);
        return new Values\CachedValue(new Values\RestUserGroup($userGroup, $contentType, $userGroupContentInfo, $userGroupLocation, $this->contentService->loadRelations($userGroup->getVersionInfo())), array('locationId' => $userGroupLocation->id));
    }