get total pages

@return int $this->pages
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;
    }
858693
protected function getPagesCount()
    {
        $query = $this->getQueryBuilder()->getQuery();
        $this->applyHints($query);
        $query->useResultCache($this->useCache, $this->cacheLifetime);

        $hasGroupBy = 0 < count($this->getQueryBuilder()->getDQLPart('groupBy'));

        $paginator = new DoctrinePaginator($query);
        // see https://github.com/doctrine/doctrine2/issues/4073
        $paginator->setUseOutputWalkers($hasGroupBy);
        $this->setRecordsCount($paginator->count());

        return ceil($this->getRecordsCount() / $this->getNumberOfElementsPerPage());
    }
1310104
protected function getPages()
    {
        $pages = $this->site->getPages();
        $additionalPageIds = [];
        if (!empty($this->indexingConfiguration['additionalPageIds'])) {
            $additionalPageIds = GeneralUtility::intExplode(',', $this->indexingConfiguration['additionalPageIds']);
        }

        $pages = array_merge($pages, $additionalPageIds);
        sort($pages, SORT_NUMERIC);

        return $pages;
    }
88545
public function paginate()
    {
        $totalCount = $this->getCount();

        $pageCount = $this->maxResults ? intval(ceil($totalCount / $this->maxResults)) : 1;
        $current = $this->page;
        $pageRange = 5;

        if ($pageCount < $current) {
            $current = $pageCount;
        }

        if ($pageRange > $pageCount) {
            $pageRange = $pageCount;
        }

        $delta = ceil($pageRange / 2);

        if ($current - $delta > $pageCount - $pageRange) {
            $pages = range($pageCount - $pageRange + 1, $pageCount);
        } else {
            if ($current - $delta < 0) {
                $delta = $current;
            }

            $offset = $current - $delta;
            $pages = range($offset + 1, $offset + $pageRange);
        }

        $proximity = floor($pageRange / 2);

        $startPage = $current - $proximity;
        $endPage = $current + $proximity;

        if ($startPage < 1) {
            $endPage = min($endPage + (1 - $startPage), $pageCount);
            $startPage = 1;
        }

        if ($endPage > $pageCount) {
            $startPage = max($startPage - ($endPage - $pageCount), 1);
            $endPage = $pageCount;
        }

        $pagination = [
            'last' => (int)$pageCount,
            'current' => (int)$current,
            'numItemsPerPage' => $this->maxResults ?? ucfirst(self::ALL_PARAMETER),
            'first' => 1,
            'pageCount' => (int)$pageCount,
            'totalCount' => (int)$totalCount,
            'pageRange' => $pageRange,
            'startPage' => (int)$startPage,
            'endPage' => (int)$endPage,
            'route' => $this->route,
            'routeParams' => $this->routeParams,
            'query' => $this->queryFilter,
            'pageParameterName' => 'page',
            'sort' => $this->sort,
        ];

        if ($current - 1 > 0) {
            $pagination['previous'] = $current - 1;
        }

        if ($current + 1 <= $pageCount) {
            $pagination['next'] = $current + 1;
        }

        $pagination['pagesInRange'] = $pages;
        $pagination['firstPageInRange'] = min($pages);
        $pagination['lastPageInRange'] = max($pages);

        $items = $this->getRecords();
        if ($items !== null) {
            $pagination['currentItemCount'] = (int)$totalCount;
            $pagination['firstItemNumber'] = $this->maxResults ? (($current - 1) * $this->maxResults) + 1 : 1;
            $pagination['lastItemNumber'] =  $pagination['firstItemNumber'] + $pagination['currentItemCount'] - 1;
        }

        return [
            'items' => $items,
            'pagination' => $pagination
        ];
    }
735854
public function totalPages()
    {
        $link = $this->_doc->navigation('self');
        return ($link && isset($link->totalpages)) ? $link->totalpages : 1;
    }
336284
public function numberOfPages(){
        if($this->totalAmount == 0){
            return 0;
        }
        $cantidad= $this->totalAmount / $this->amountPerPage;
        if(is_int($cantidad)){
            return $cantidad;
        }else{
            $cantidad_int= intval($cantidad);
            if($cantidad_int > $cantidad){
                return $cantidad_int;
            }else{
                return $cantidad_int + 1;
            }
        }
    }
540995
public function getNextPage()
    {
        $lastPage = $this->getLastPage();

        return $this->page < $lastPage ? $this->page + 1 : $lastPage;
    }
754411
public function getApproximatePageCount()
    {
        $siteTreeIDList = array_merge([0], $this->getSiteTreesIDList());
        $connection = $this->getConnection();
        $result = $connection->fetchColumn('select count(*) from Pages where siteTreeID is null or siteTreeID in (' . implode(', ', $siteTreeIDList) . ')');

        return $result ?: 0;
    }
1107879
public function getTotalPage()
    {
        $this->pageSize > 0 || $this->pageSize = 10;

        $totalPage = ceil($this->total / $this->pageSize);

        $totalPage >= 1 || $totalPage = 1;

        return $totalPage;
    }
286084
public function getPagesNumber() {
		if ($this->_entirePagesNumber === null) {
			$this->_entirePagesNumbe = (int) ceil($this->getAdapter()->count() / $this->_itemsPerPage);
		}
		
		return $this->_entirePagesNumbe;
	}
872203
public function total_pages( $limit = null, $offset = null, $total = null ) {

		$this->do_hook( 'total_pages' );

		if ( null === $limit ) {
			$limit = $this->limit;
		}

		if ( null === $offset ) {
			$offset = $this->offset;
		}

		if ( null === $total ) {
			$total = $this->total_found();
		}

		return ceil( ( $total - $offset ) / $limit );

	}
353099
protected function getPages($totalPages, $currentPage)
    {
        $range = range(1, $totalPages);
        $pages = [];
        foreach ($range as $page) {
            $pages[] = [
                'number' => $page,
                'active' => (int)$page === (int)$currentPage
            ];
        }

        return $pages;
    }
408551
public function getVisitedPages()
    {
        $dates = $this->getStartEndDate();

        $items = LaravelAnalytics::getMostVisitedPagesForPeriod($dates['start'], $dates['end']);

        return $items;
    }
351190
public function getPage()
	{
		return $this->offset > $this->limit ? floor($this->offset / $this->limit) : 1;
	}
869808
private function getPagesCount()
    {
        if ($this->getItemsPerPage() != 0) {
            return (int) abs(ceil($this->getTotalAmount() / $this->getItemsPerPage()));
        } else {
            return 0;
        }
    }
846665
public function getPageCount() : int
    {
        if($this->lastResponse && $this->lastResponse->getHeaderLine('X-Total-Pages')) {
            return (int)$this->lastResponse->getHeaderLine('X-Total-Pages');
        }

        return 0;
    }
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;
    }