@param AbstractQuery $query
@param int           $perPage
@param int           $page
@param bool          $fetchJoinCollection

@return PaginatorAdapter
320738
public static function fromParams(AbstractQuery $query, $perPage = 15, $page = 1, $fetchJoinCollection = true)
    {
        return new static(
            $query,
            $perPage,
            function () use ($page) {
                return $page;
            },
            $fetchJoinCollection
        );
    }
731819
public function paginate(Query $query, $perPage, $pageName = 'page', $fetchJoinCollection = true)
    {
        return (new PaginatorAdapter())->make(
            $query,
            $perPage,
            $pageName,
            $fetchJoinCollection
        );
    }
127580
public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
    {
        $cacheKey = $this->generateKey([$perPage, $columns, $pageName, $page]);

        return $this->cacheResults(get_called_class(), __FUNCTION__, $cacheKey, function () use ($perPage, $columns, $pageName, $page) {
            return $this->model->paginate($perPage, $columns, $pageName, $page);
        });
    }
532630
public function forPage(int $page, int $perPage): CollectionInterface
    {
        $page--;
        $offset = $page * $perPage;

        return $this->slice($offset, $perPage);
    }
1299414
public function pagination($page, $limit, $query = null, $orderBy = null, $sort = 'ASC', $filter = null)
    {
        return $this->getMapper()->pagination($page, $limit, $query, $orderBy, $sort, $filter);
    }
503919
public function paginate($start, $limit, $fetchJoinCollection = true)
    {
        $this->setFirstResult($start)
             ->setMaxResults($limit);

        return new Paginator($this, $fetchJoinCollection);
    }
11338
public function paginate(Builder $builder, $perPage, $page)
    {
        $result = $this->performSearch($builder, [
            'numericFilters' => $this->filters($builder),
            'from' => (($page * $perPage) - $perPage),
            'size' => $perPage,
        ]);

       $result['nbPages'] = $result['hits']['total']/$perPage;

        return $result;
    }
876851
protected function createContentSearchHitPager(Query $query, $currentPage, $maxPerPage)
    {
        @trigger_error(
            'PagerfantaFindTrait is deprecated since version 2.5 and will be removed in 3.0. Use PagerfantaTrait instead.',
            E_USER_DEPRECATED
        );

        $adapter = new ContentSearchHitAdapter($query, $this->getSite()->getFindService());

        return $this->getPager($adapter, $currentPage, $maxPerPage);
    }
712729
public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
    {
        $page = $page ?: Paginator::resolveCurrentPage($pageName);

        $perPage = $perPage ?: $this->model->getPerPage();

        $results = ($total = $this->toBase()->getCountForPagination())
                                    ? $this->forPage($page, $perPage)->get($columns)
                                    : $this->model->newCollection();

        return $this->paginator($results, $total, $perPage, $page, [
            'path' => Paginator::resolveCurrentPath(),
            'pageName' => $pageName,
        ]);
    }
47788
public function paginate($perPage = null, $columns = array('*'))
	{
		$this->query->addSelect($this->getSelectColumns($columns));

		$paginator = $this->query->paginate($perPage, $columns);

		$this->hydratePivotRelation($paginator->items());

		return $paginator;
	}
828588
public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
    {
        $columns = $this->shouldSelect($columns);

        $columns = array_diff($columns, [$this->getQualifiedFirstKeyName().' as laravel_through_key']);

        $this->query->addSelect($columns);

        return tap($this->query->paginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) {
            $this->hydrateIntermediateRelations($paginator->items());
        });
    }
708844
private function shouldDoctrinePaginatorFetchJoinCollection(QueryBuilder $queryBuilder, string $resourceClass = null, string $operationName = null): bool
    {
        if (null !== $resourceClass) {
            $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);

            if (null !== $fetchJoinCollection = $resourceMetadata->getCollectionOperationAttribute($operationName, 'pagination_fetch_join_collection', null, true)) {
                return $fetchJoinCollection;
            }
        }

        /*
         * "Cannot count query which selects two FROM components, cannot make distinction"
         *
         * @see https://github.com/doctrine/orm/blob/v2.6.3/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php#L81
         * @see https://github.com/doctrine/doctrine2/issues/2910
         */
        if (QueryChecker::hasRootEntityWithCompositeIdentifier($queryBuilder, $this->managerRegistry)) {
            return false;
        }

        if (QueryChecker::hasJoinedToManyAssociation($queryBuilder, $this->managerRegistry)) {
            return true;
        }

        // disable $fetchJoinCollection by default (performance)
        return false;
    }
40204
public function getAllPaginated($orderBy = array('id', 'asc'), $perPage = 25)
    {
        list($column, $order) = $orderBy;

        return $this->newQuery()->orderBy($column, $order)->paginate($perPage);
    }
607615
public function paginate($page, $perPage = null)
    {
        if ($page < 1) {
            $page = 1;
        }
        
        $paginator = new Paginator($this->select, $this->adapter());
        $items     = $paginator->getItems(($page - 1) * $perPage, $perPage);
        
        return $items->toArray();
    }
1312722
public function scopePaginateFilter($query, $perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
    {
        $perPage = $perPage ?: config('eloquentfilter.paginate_limit');
        $paginator = $query->paginate($perPage, $columns, $pageName, $page);
        $paginator->appends($this->filtered);

        return $paginator;
    }
1126290
static public function paginate($page, $per_page)
    {
        $query = self::createRelation();
        return $query->paginate($page, $per_page);
    }
485098
public function paginate($page, $perPage = null)
    {
        $this->queryDefaults['paged'] = $page;
        $this->queryDefaults['posts_per_page'] = $perPage ?: get_option('posts_per_page');

        return $this;
    }