{@inheritdoc}

@see \Concrete\Core\Search\ItemList\ItemList::createPaginationObject()
776344
protected function createPaginationObject()
    {
        $adapter = new DoctrineDbalAdapter(
            $this->deliverQueryObject(),
            function (\Doctrine\DBAL\Query\QueryBuilder $query) {
                $query
                    ->resetQueryParts(['groupBy', 'orderBy'])
                    ->select('count(distinct p.id)')
                    ->setMaxResults(1);
            }
        );
        $pagination = new Pagination($this, $adapter);

        return $pagination;
    }
159122
public function create(array $row = null)
    {
        $result = clone $this->tableGateway->getResultSetPrototype()->getArrayObjectPrototype();
        if (!$result instanceof RowGatewayInterface) {
            throw new \RuntimeException('ArrayObject Prototype is not instanceof RowGatewayInterface');
        }
        $row && $result->populate($row + $result->toArray(), isset($row[current($this->getPrimary())]));
        return $result;
    }
1236033
public function make()
    {
        if (empty($this->_columns)) {
            throw new CollectionException('At least one column is required to generate a resource table.');
        }

        // Prepare builder object before calling Table
        $this->_prepareBuilder();

        // Finally execute prepared query builder
        $items = $this->_builder->get();

        return with(new Table($items, [
            'collection_generator' => $this,
            'columns'              => $this->_columns,
            'per_page'             => $this->_perPage,
            'paginate'             => $this->_paginate,
            'paginator_presenter'  => $this->_getPaginatorPresenter($items),
            'view_name'            => $this->_viewName,
            'filter'               => $this->_filter,
            'extra'                => $this->_extraViewData,
        ]))->make();
    }
1217019
public function createPagination($source, array $parameters, PaginationHandlerInterface $handler = null)
    {
        return new Pagination(
            $source,
            $parameters,
            $handler ? $handler : new NativePaginationHandler(),
            $this->findDataSource($source)
        );
    }
455769
public function paginate(AbstractQuery $query, $perPage, $pageName = 'page', $fetchJoinCollection = true)
    {
        return PaginatorAdapter::fromRequest(
            $query,
            $perPage,
            $pageName,
            $fetchJoinCollection
        )->make();
    }
1344810
public function createComponentPaginator()
	{
		/**
		 * Init paginator
		 */
		$component = new Components\DataGridPaginator\DataGridPaginator(
			$this->getTranslator(),
			static::$icon_prefix
		);
		$paginator = $component->getPaginator();

		$paginator->setPage($this->page);
		$paginator->setItemsPerPage($this->getPerPage());

		if ($this->custom_paginator_template) {
			$component->setTemplateFile($this->custom_paginator_template);
		}

		return $component;
	}
1034126
public function paginate($per_page = 10, $page_name = "page", $page = null)
    {

        $this->take($per_page);

        $page = $page ?: Request::get($page_name, 1);

        $this->skip(($page * $per_page) - $per_page);

        $objects = $this->get();

        return new Pagination($objects, $objects->total, $per_page, $page, ['path' => Request::url(), 'query' => Request::query()]);
    }
279591
public function requestRepresentableQueryItem(): QueryItem {
		$selectBuilder  = $this->queryState->getPdo()->getMetaData()->createSelectStatementBuilder();
		$this->queryModel->apply($selectBuilder);
		
		return $selectBuilder->toQueryResult();
	}
1051305
public function index(): PaginatedDataInterface
    {
        $builder = $this->createIndexModelBuilder();
        $data    = $this->fetchResources($builder, $builder->getModelClass());

        return $data;
    }
417977
public function getCollection(string $resourceClass, string $operationName = null): iterable
    {
        $collection = $this->repository->findAll($resourceClass);

        return new Paginator(new GenericPaginatedDomainCollection((static function () use ($collection): iterable {
            foreach ($collection as $document) {
                yield $document->toProjection();
            }
        })(), $collection->getOffset(), $collection->getLimit(), (float) \count($collection), $collection->getTotalCount()));
    }
386107
public function simplePaginate($perPage = null, $columns = array('*'), $pageName = 'page', $page = null)
    {
        if (is_null($page)) {
            $page = Paginator::resolveCurrentPage($pageName);
        }

        $path = Paginator::resolveCurrentPath($pageName);

        if (is_null($perPage)) {
            $perPage = $this->model->getPerPage();
        }

        $offset = ($page - 1) * $perPage;

        $results = $this->skip($offset)->take($perPage + 1)->get($columns);

        return new SimplePaginator($results, $perPage, $page, compact('path', 'pageName'));
    }
1267731
public function getPaginatorAdapter(PaginableCriteriaInterface $criteria = null)
    {
        if (null === $criteria) {
            $criteria = $this->getPaginatorCriteria();
        }

        return $criteria->getPaginatorAdapter($this);
    }
476411
public function actionCreatePageItem()
    {
        $this->menuFlush();
        $model = new Nav();
        $create = $model->createPageItem($this->postArg('nav_id'), $this->postArg('lang_id'), $this->postArg('title'), $this->postArg('alias'), $this->postArg('layout_id'), $this->postArg('description'));
        if (is_array($create)) {
            Yii::$app->response->statusCode = 422;
        }

        return $create;
    }
1337145
public function paginate($items, $perPage = null, $pageName = 'page', $page = null)
    {
        if (is_array($items)) {
            $items = collect($items);
        }

        $page = $page ?: Paginator::resolveCurrentPage($pageName);

        $perPage = $perPage ?: $items[0]->getPerPage();

        $results = $items->forPage(Paginator::resolveCurrentPage(), $perPage);

        $total = $items->count();

        return new LengthAwarePaginator($results, $total, $perPage, $page, [
            'path'     => Paginator::resolveCurrentPath(),
            'pageName' => $pageName,
        ]);
    }
327696
public function setPaginate($paginate, $itemCountPerPage = null, array $paramsKeys = null)
    {
        $this->paginate = (bool) $paginate;
        if ($itemCountPerPage !== null) {
            $this->setItemCountPerPage($itemCountPerPage);
        }
        if (is_array($paramsKeys)) {
            $this->setParamsKeys($paramsKeys);
        }
        return $this;
    }
676275
public function findPaginated(
        $entityClass,
        array $criteria,
        $sorting = [],
        $offset = Request\Params::DEFAULT_PAGE_OFFSET,
        $limit = Request\Params::DEFAULT_PAGE_SIZE,
        $translatable = false
    )
    {
        $qb = $this->getQueryBuilder($entityClass, $criteria, $sorting, $translatable);
        
        $qb->setFirstResult($offset)
            ->setMaxResults($limit);

        $paginator = new Paginator($qb->getQuery());
        $collection = new PaginatedCollection($paginator);

        return $collection;
    }
1076907
public function paginator()
    {
        $paginator = $this->paginate();

        if (!is_null($this->presenter)) {
            return (new $this->presenter($paginator))->render();
        }

        return $paginator->render();
    }