eZ\Publish\Core\REST\Server\Controller\User::loadUsersFromGroup PHP 메소드

loadUsersFromGroup() 공개 메소드

Loads the users of the group with the given path.
public loadUsersFromGroup ( $groupPath, Request $request ) : UserList | UserRefList
$groupPath
$request Symfony\Component\HttpFoundation\Request
리턴 eZ\Publish\Core\REST\Server\Values\UserList | eZ\Publish\Core\REST\Server\Values\UserRefList
    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));
    }