Returns an array containing the arguments for the pagination: total rows, pages, first record etc

@return array
545782
protected function getPagerArguments()
    {
        return array(
            'total-rows' => $this->getTotalRecords(),
            'total-pages' => $this->getTotalPages(),
            'items-per-page' => $this->getItemsPerPage(),
            'first-shown' => $this->getFirstShown(),
            'last-shown' => $this->getLastShown(),
        );
    }
1000060
public function getLastPageParams()
    {
        $limit = $this->limit <= 0 ? $this->count : $this->limit;
        $last_page = intdiv(intval($this->count), intval($limit));
        $last_url = $this->offset_key
            . ($last_page * $limit)
            . $this->limit_key
            . $limit;

        return $last_url;
    }
922917
public function handlePagination($args)
    {
        $uri = $args['uri'];
        $current = $args['current'];
        $total = $args['total'];
        $limit = $args['limit'];

        $uri   = preg_replace('/offset=([0-9]+)/', '', $uri);
        $pages = ceil($total / $limit);
        $page  = $current;

        if ($pages < 2) {
            return;
        }

        $start = 1;

        if ($page >= 3) {
            $start = $page - 2;
        }

        $rtn = '<ul class="pagination">';

        $rtn .= $this->getPaginationPrevLink($page, $uri);

        for ($i = 0; $i < 5 && ($start + $i) <= $pages; $i++) {
            $num = $start + $i;
            $cls = ($page == $num ? 'active' : '');
            $rtn .= '<li class="' . $cls . '"><a href="' . $uri . 'p=' . $num . '">' . $num . '</a></li>';
        }

        $rtn .= $this->getPaginationNextLink($page, $uri, $pages);

        $rtn .= '</ul>';

        return $rtn;
    }
448636
private function determinePageIdFromArguments()
    {
        if (empty($this->argumentNameOfPageId)) {
            return 0;
        }

        if (false === array_key_exists($this->argumentNameOfPageId, $this->restler->apiMethodInfo->arguments)) {
            return 0;
        }

        $index = $this->restler->apiMethodInfo->arguments[$this->argumentNameOfPageId];
        $pageId = (integer) $this->restler->apiMethodInfo->parameters[$index];
        return $pageId;
    }
715684
protected function paginationRanger()
    {
        $parameters = [
            'first' => $this->paginator->firstItem(),
            'last'  => $this->paginator->lastItem(),
            'total' => $this->paginator->total(),
        ];

        $parameters = collect($parameters)->flatMap(function ($parameter, $key) {
            return [$key => "<b>$parameter</b>"];
        });

        return trans('admin.pagination.range', $parameters->all());
    }
759797
public function getPageData($style = DEFAULT_PAGE_STYLE, $showFirstPage=false) {

        if ( $this->pageNum <= 1 && $showFirstPage == false ) return array();

        $pages = array('url' => $this->buildUrl($this->url.'{page}'));
        if ( $style & PAGE_TOTAL_NUM ) $pages['total'] = $this->totalRows;
        $pages['first'] = $this->buildUrl($this->url."1");
        if ( $style & PAGE_PREV ) {
            if ( $this->pageNow > 1 ) {
                $pages['prev'] = $this->buildUrl($this->url.($this->pageNow -1));
            } else {
                $pages['prev'] = '#';
            }
        }

        if ( $style & PAGE_LIST ) {
            $pages['list'] = $this->printPageList($style, 'array');
        }
        if ( $style & PAGE_NEXT ) {
            if ( $this->pageNow < $this->pageNum ) {
                $pages['next'] = $this->buildUrl($this->url.($this->pageNow +1));
            } else {
                $pages['next'] = '#';
            }
        }
        $pages['page'] = $this->pageNow;
        $pages['last'] = $this->buildUrl($this->url.$this->pageNum);
        return $pages;

    }
104392
public function toArray()
	{
		return array(
			'total' => $this->total, 'per_page' => $this->perPage,
			'current_page' => $this->currentPage, 'last_page' => $this->lastPage,
			'from' => $this->from, 'to' => $this->to, 'data' => $this->getCollection()->toArray(),
		);
	}
1026148
private function getPagination()
    {
        # pagination
        $this->pagination['page'] = 1;
        $this->pagination['per_page'] = Utils::findKey($this->options, 'limit', 50);
        $this->pagination['padding'] = Utils::findKey($this->options, 'padding', 0);
        $this->pagination['offset'] = Utils::findKey($this->options, 'offset', 0);

        $this->payload['size'] = $this->pagination['per_page'];
        $this->payload['from'] = $this->pagination['offset'];
    }
879905
protected function get_firstpage() {
        $pages = $this->load_all_pages();
        if (count($pages) > 0) {
            foreach ($pages as $page) {
                if ((int)$page->prevpageid === 0) {
                    return $page;
                }
            }
        }
        return false;
    }
967119
public function getTotalPages()
    {
        if (!isset($this->pages)) {
            $recordCount = $this->getTotalRecordCount();
            if ($this->max > 0) {
                $this->pages = ceil($recordCount / $this->max);
            } else {
                $this->pages = 0;
            }
        }

        return $this->pages;
    }
774199
private function getNextPageQueryCriteria() {
        $start = $this->getIndexCriteria()->getOffset() + $this->getIndexCriteria()->getLimit();
        return array(
            'start' => $start,
            'count' => $this->getIndexCriteria()->getLimit()
        );
    }
733404
private function createArgs()
    {
        $args = array($this->db);

        if (is_object($this->paginator)) {
            array_push($args, $this->paginator);
        }

        array_push($args, $this->prefix);
        return $args;
    }
491661
public function getPagination(): array
    {
        if ($this->pagination === null) {
            $this->pagination = $this->setPagination();
        }

        return $this->pagination;
    }
350730
protected function buildPagination()
    {
        $this->calculateDisplayRange();
        $pages = array();
        for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {
            $pages[] = array('number' => $i, 'isCurrent' => ($i === $this->currentPage));
        }
        $pagination = array(
            'pages' => $pages,
            'current' => $this->currentPage,
            'numberOfPages' => $this->numberOfPages,
            'displayRangeStart' => $this->displayRangeStart,
            'displayRangeEnd' => $this->displayRangeEnd,
            'hasLessPages' => $this->displayRangeStart > 2,
            'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages
        );
        if ($this->currentPage < $this->numberOfPages) {
            $pagination['nextPage'] = $this->currentPage + 1;
        }
        if ($this->currentPage > 1) {
            $pagination['previousPage'] = $this->currentPage - 1;
        }
        return $pagination;
    }
324512
protected function extractPagination()
    {
        Logger::log(static::class . ' extract pagination start', LOG_DEBUG);
        $page = array_key_exists(self::API_PAGE_FIELD, $this->query) ? $this->query[self::API_PAGE_FIELD] : 1;
        $limit = array_key_exists(self::API_LIMIT_FIELD, $this->query) ? $this->query[self::API_LIMIT_FIELD] : 100;
        Logger::log(static::class . ' extract pagination end', LOG_DEBUG);
        return array($page, (int)$limit);
    }
384514
public function pagination() {
		global $post, $page, $numpages, $multipage;
		$post = $this;
		$ret = array();
		if ( $multipage ) {
			for ( $i = 1; $i <= $numpages; $i++ ) {
				$link = self::get_wp_link_page($i);
				$data = array('name' => $i, 'title' => $i, 'text' => $i, 'link' => $link);
				if ( $i == $page ) {
					$data['current'] = true;
				}
				$ret['pages'][] = $data;
			}
			$i = $page - 1;
			if ( $i ) {
				$link = self::get_wp_link_page($i);
				$ret['prev'] = array('link' => $link);
			}
			$i = $page + 1;
			if ( $i <= $numpages ) {
				$link = self::get_wp_link_page($i);
				$ret['next'] = array('link' => $link);
			}
		}
		return $ret;
	}
1138973
public function all() {
        $size = $this->maxPageSize();

        $firstPageResponse = $this->request( $this->createPaginatedRequestQuery( 0, $size ) );
        $header_values = $firstPageResponse->getResponse()->getHeader('X-Result-Total');
        $total = array_shift($header_values);

        $result = $firstPageResponse->json();

        if( $total <= $size ) {
            return $result;
        }

        $requests = [];
        for( $page = 1; $page < ceil( $total / $size ); $page++ ) {
            $requests[] = $this->createPaginatedRequestQuery( $page, $size );
        }

        $responses = $this->requestMany( $requests );

        foreach( $responses as $response ) {
            $result = array_merge( $result, $response->json() );
        }

        return $result;
    }