perform the query to get a limited result
@param int $requestedPage
@return bool
189992
public function queryPage(int $requestedPage): bool
    {
        // clear
        $this->page = 0;
        $this->totalRecords = null;
        $this->recordset = null;
        // request
        $page = min($this->getTotalPages(), max(1, $requestedPage));
        $query = $this->dbal->sqlLimit($this->getQueryData(), $page, $this->getPageSize());
        $recordset = $this->dbal->queryRecordset($query);
        if (false === $recordset) {
            return false;
        }
        $this->page = $page;
        $this->recordset = $recordset;
        return true;
    }
1088238
public function getPagedResults($limit = 50, $page = 0)
    {
        $dql = sprintf(self::DQL_GET_PAGED, AuditEvent::class);
        return $this->getPaginator($dql, $limit, $page);
    }
902404
public function getPagedResults($limit = 50, $page = 0): Paginator
    {
        $dql = sprintf(self::DQL_GET_PAGED, TargetTemplate::class);
        return $this->getPaginator($dql, $limit, $page);
    }
11370
public function page($page)
    {
        if (! $this->limit) return;
        $offset = $this->limit * ($page - 1);
        $this->offset($offset);
        return $this;
    }
449622
public function get(int $page, int $limit = 10): \Illuminate\Pagination\LengthAwarePaginator
    {
        if (!$this->_columns && !$this->_query) {
            return null;
        }
        $countTotal = $this->_query->count();
        $this->_query->skip(($limit * $page) - $limit);
        $this->_query->limit($limit);
        $data = collect();
        foreach ($this->_query->get() as $key => $instance) {
            if ($instance instanceof \Illuminate\Database\Eloquent\Model) {
                $_listRow = [];
                foreach ($this->_columns->getColumns() as $column) {
                    $_listRow[$column->getKey()] = $column->getValues($instance);
                }
                $buttons = $this->_columns->filterActions($instance);
                if (count($buttons)) {
                    $_listRow = array_merge($_listRow, [Column::ACTION_NAME => implode('', $buttons)]);
                }
                $data->offsetSet($key, $_listRow);
            }
        }
        $this->_data = new \Illuminate\Pagination\LengthAwarePaginator($data, $countTotal, $limit, $page, [
            'path'     => \Illuminate\Pagination\Paginator::resolveCurrentPath(),
            'pageName' => 'page',
        ]);

        return $this->_data;
    }
157104
public function paginate(int $page = 1, int $perPage = 25) : self
    {
        return $this->limit($perPage, ($page - 1) * $perPage);
    }
1364384
public function execute(int $page, int $limit): void
    {
        $page = $page <= 1 ? 1 : $page;
        $rows = $this->getRows($page, $limit);

        $headers = [];
        $mode = 'a';
        if (1 === $page) {
            $headers = $this->getHeaders();
            $mode = 'w';
        }

        // Prepend columns to result
        if (!empty($headers)) {
            array_unshift($rows, $headers);
        }

        $this->create($rows, $mode);
    }
405085
private function loadPaginated(array $options, $limit, $page, $pageSize)
    {
        $pageSize = intval($pageSize);
        $offset = ($page - 1) * $pageSize;

        $position = $pageSize * $page;
        if (null !== $limit && $position >= $limit) {
            $pageSize = $limit - $offset;
            $loadLimit = $pageSize;
        } else {
            $loadLimit = $pageSize + 1;
        }

        return $this->contentQueryExecutor->execute(
            $options['webspaceKey'],
            [$options['locale']],
            $this->contentQueryBuilder,
            true,
            -1,
            $loadLimit,
            $offset
        );
    }
1115745
public function getAllUsers($page, $max = 20, $orderedBy = 'id', $order = null)
    {
        $query = $this->userRepo->findAll(false, $orderedBy, $order);

        return $this->pagerFactory->createPager($query, $page, $max);
    }
462852
public function paginate($page = 1, $pageSize = 10)
    {
        return $this
            ->limit($pageSize)
            ->offset($page > 1 ? $pageSize * ($page - 1) : 0);
    }
1272932
public function getPaginatedData($tableName, $page = 1, $limit = 10, $orderAttribute = null, $order = 'ASC')
    {
        Paginator::currentPageResolver(function () use ($page) {
            return $page;
        });
        $data = $this->database->table($tableName);
        if (null === $orderAttribute) {
            return $data->paginate($limit)->toArray();
        }
        return $data->orderBy($orderAttribute, $order)->paginate($limit)->toArray();
    }
137700
public function getPagedResults($limit = 25, $page = 0)
    {
        $template = self::DQL_ALL;
        $dql = sprintf($template, Application::class);

        return $this->getPaginator($dql, $limit, $page, []);
    }
706893
protected function isPageEmpty(AbstractPage $page)
    {
        if ($page->get('route')) {
            return false;
        }
        
        if (!$page->hasPages(true)) {
            return true;
        }
        
        $isGranted = $this->getView()->plugin('isGranted');
        foreach ($page->getPages() as $childPage) {
            if (!$childPage->isVisible()) {
                continue;
            }
            
            if ($isGranted($childPage->get('permission'))) {
                return false;
            }
        }
        
        return true;
    }
1247151
public function page($page)
    {
        $this->limit  = 0;
        $this->offset = 0;

        $page = (int)$page;
        if ($page > 0) {
            $this->limit  = $this->paging;
            $this->offset = $this->paging * ($page - 1);
        }
        return $this;
    }
322788
public function getData($pageSize, $page)
    {
        $limit = ($page - 1) * $pageSize;
        $offset = $pageSize;
        $sql = "{$this->sqlment} LIMIT {$limit}, {$offset}";

        return $this->db->findAllBySql($sql, $this->params);
    }
875828
private function getPaginator($dql, $limit, $page, array $parameters = [])
    {
        $query = $this->getEntityManager()
            ->createQuery($dql)
            ->setMaxResults($limit)
            ->setFirstResult($limit * $page);

        foreach ($parameters as $param => $value) {
            $query = $query->setParameter($param, $value);
        }

        return new Paginator($query);
    }
683994
public function setPage(int $page = 1): Select
    {
        if (!$this->limit) {
            throw new DbException('Please setup limit for use method `setPage`');
        }
        $this->offset = $this->limit * ($page - 1);
        return $this;
    }