public function loadUsersFromGroup($groupPath, Request $request)
{
$userGroupLocation = $this->locationService->loadLocation($this->extractLocationIdFromPath($groupPath));
$userGroup = $this->userService->loadUserGroup($userGroupLocation->contentId);
$offset = $request->query->has('offset') ? (int) $request->query->get('offset') : 0;
$limit = $request->query->has('limit') ? (int) $request->query->get('limit') : 25;
$users = $this->userService->loadUsersOfUserGroup($userGroup, $offset >= 0 ? $offset : 0, $limit >= 0 ? $limit : 25);
$restUsers = array();
foreach ($users as $user) {
$userContentInfo = $user->getVersionInfo()->getContentInfo();
$userLocation = $this->locationService->loadLocation($userContentInfo->mainLocationId);
$contentType = $this->contentTypeService->loadContentType($userContentInfo->contentTypeId);
$restUsers[] = new Values\RestUser($user, $contentType, $userContentInfo, $userLocation, $this->contentService->loadRelations($user->getVersionInfo()));
}
if ($this->getMediaType($request) === 'application/vnd.ez.api.userlist') {
return new Values\CachedValue(new Values\UserList($restUsers, $request->getPathInfo()), array('locationId' => $userGroupLocation->id));
}
return new Values\CachedValue(new Values\UserRefList($restUsers, $request->getPathInfo()), array('locationId' => $userGroupLocation->id));
}