public function loadUsers(Request $request)
    {
        $restUsers = array();

        try {
            if ($request->query->has('roleId')) {
                $restUsers = $this->loadUsersAssignedToRole(
                    $this->requestParser->parseHref($request->query->get('roleId'), 'roleId')
                );
            } elseif ($request->query->has('remoteId')) {
                $restUsers = array(
                    $this->buildRestUserObject(
                        $this->userService->loadUser(
                            $this->contentService->loadContentInfoByRemoteId($request->query->get('remoteId'))->id,
                            Language::ALL
                        )
                    ),
                );
            } elseif ($request->query->has('login')) {
                $restUsers = array(
                    $this->buildRestUserObject(
                        $this->userService->loadUserByLogin($request->query->get('login'), Language::ALL)
                    ),
                );
            } elseif ($request->query->has('email')) {
                foreach ($this->userService->loadUsersByEmail($request->query->get('email'), Language::ALL) as $user) {
                    $restUsers[] = $this->buildRestUserObject($user);
                }
            }
        } catch (ApiExceptions\UnauthorizedException $e) {
            $restUsers = [];
        }

        if (empty($restUsers)) {
            throw new NotFoundException('No users were found with the given filter');
        }

        if ($this->getMediaType($request) === 'application/vnd.ez.api.userlist') {
            return new Values\UserList($restUsers, $request->getPathInfo());
        }

        return new Values\UserRefList($restUsers, $request->getPathInfo());
    }
public function loadUsers(Request $request)
    {
        $restUsers = array();

        try {
            if ($request->query->has('roleId')) {
                $restUsers = $this->loadUsersAssignedToRole(
                    $this->requestParser->parseHref($request->query->get('roleId'), 'roleId')
                );
            } elseif ($request->query->has('remoteId')) {
                $restUsers = array(
                    $this->buildRestUserObject(
                        $this->userService->loadUser(
                            $this->contentService->loadContentInfoByRemoteId($request->query->get('remoteId'))->id,
                            Language::ALL
                        )
                    ),
                );
            } elseif ($request->query->has('login')) {
                $restUsers = array(
                    $this->buildRestUserObject(
                        $this->userService->loadUserByLogin($request->query->get('login'), Language::ALL)
                    ),
                );
            } elseif ($request->query->has('email')) {
                foreach ($this->userService->loadUsersByEmail($request->query->get('email'), Language::ALL) as $user) {
                    $restUsers[] = $this->buildRestUserObject($user);
                }
            }
        } catch (ApiExceptions\UnauthorizedException $e) {
            $restUsers = [];
        }

        if (empty($restUsers)) {
            throw new NotFoundException('No users were found with the given filter');
        }

        if ($this->getMediaType($request) === 'application/vnd.ez.api.userlist') {
            return new Values\UserList($restUsers, $request->getPathInfo());
        }

        return new Values\UserRefList($restUsers, $request->getPathInfo());
    }
public function loadUsers ( Request $ request ) { $ restUsers = array ( ) ; try { if ( $ request -> query -> has ( 'roleId' ) ) { $ restUsers = $ this -> loadUsersAssignedToRole ( $ this -> requestParser -> parseHref ( $ request -> query -> get ( 'roleId' ) , 'roleId' ) ) ; } elseif ( $ request -> query -> has ( 'remoteId' ) ) { $ restUsers = array ( $ this -> buildRestUserObject ( $ this -> userService -> loadUser ( $ this -> contentService -> loadContentInfoByRemoteId ( $ request -> query -> get ( 'remoteId' ) ) -> id , Language :: ALL ) ) , ) ; } elseif ( $ request -> query -> has ( 'login' ) ) { $ restUsers = array ( $ this -> buildRestUserObject ( $ this -> userService -> loadUserByLogin ( $ request -> query -> get ( 'login' ) , Language :: ALL ) ) , ) ; } elseif ( $ request -> query -> has ( 'email' ) ) { foreach ( $ this -> userService -> loadUsersByEmail ( $ request -> query -> get ( 'email' ) , Language :: ALL ) as $ user ) { $ restUsers [ ] = $ this -> buildRestUserObject ( $ user ) ; } } } catch ( ApiExceptions \ UnauthorizedException $ e ) { $ restUsers = [ ] ; } if ( empty ( $ restUsers ) ) { throw new NotFoundException ( 'No users were found with the given filter' ) ; } if ( $ this -> getMediaType ( $ request ) === 'application/vnd.ez.api.userlist' ) { return new Values \ UserList ( $ restUsers , $ request -> getPathInfo ( ) ) ; } return new Values \ UserRefList ( $ restUsers , $ request -> getPathInfo ( ) ) ; }
Loads users.

@return \eZ\Publish\Core\REST\Server\Values\UserList|\eZ\Publish\Core\REST\Server\Values\UserRefList
Loads users .