protected function getUsers(): array
    {
        return $this->repository->sudo(function (Repository $repository) {
            $query = new LocationQuery();
            $query->filter = new ContentTypeIdentifier('user');
            $query->offset = 0;
            $query->limit = 10;
            $query->performCount = true;
            $query->sortClauses[] = new SortClause\ContentName();

            $users = [];
            do {
                $results = $repository->getSearchService()->findContent($query);
                foreach ($results->searchHits as $hit) {
                    $users[] = $repository->sudo(function (Repository $repository) use ($hit) {
                        return $repository->getUserService()->loadUser($hit->valueObject->id);
                    });
                }

                $query->offset += $query->limit;
            } while ($query->offset < $results->totalCount);

            return $users;
        });
    }
protected function getUsers(): array
    {
        return $this->repository->sudo(function (Repository $repository) {
            $query = new LocationQuery();
            $query->filter = new ContentTypeIdentifier('user');
            $query->offset = 0;
            $query->limit = 10;
            $query->performCount = true;
            $query->sortClauses[] = new SortClause\ContentName();

            $users = [];
            do {
                $results = $repository->getSearchService()->findContent($query);
                foreach ($results->searchHits as $hit) {
                    $users[] = $repository->sudo(function (Repository $repository) use ($hit) {
                        return $repository->getUserService()->loadUser($hit->valueObject->id);
                    });
                }

                $query->offset += $query->limit;
            } while ($query->offset < $results->totalCount);

            return $users;
        });
    }
protected function getUsers ( ) : array { return $ this -> repository -> sudo ( function ( Repository $ repository ) { $ query = new LocationQuery ( ) ; $ query -> filter = new ContentTypeIdentifier ( 'user' ) ; $ query -> offset = 0 ; $ query -> limit = 10 ; $ query -> performCount = true ; $ query -> sortClauses [ ] = new SortClause \ ContentName ( ) ; $ users = [ ] ; do { $ results = $ repository -> getSearchService ( ) -> findContent ( $ query ) ; foreach ( $ results -> searchHits as $ hit ) { $ users [ ] = $ repository -> sudo ( function ( Repository $ repository ) use ( $ hit ) { return $ repository -> getUserService ( ) -> loadUser ( $ hit -> valueObject -> id ) ; } ) ; } $ query -> offset += $ query -> limit ; } while ( $ query -> offset < $ results -> totalCount ) ; return $ users ; } ) ; }
Get users list.

@return User[]
Get users list .