Get an array of paginated page data
@return array
8177
public function getPages()
    {
        $pages = array();

        if ($this->pages <= 1) {
            return array();
        }

        if ($this->pages <= $this->limit_pages) {
            for ($i = 1; $i <= $this->pages; $i++) {
                $pages[] = $this->createPage($i, $i == $this->current);
            }

            return $pages;
        }

        $num_adjacents = (int) floor(($this->limit_pages - 3) / 2);

        if ($this->current + $num_adjacents > $this->pages) {
            $sliding_start = $this->pages - $this->limit_pages + 2;
        } else {
            $sliding_start = $this->current - $num_adjacents;
        }

        if ($sliding_start < 2) {
            $sliding_start = 2;
        }

        $sliding_end = $sliding_start + $this->limit_pages - 3;

        if ($sliding_end >= $this->pages) {
            $sliding_end = $this->pages - 1;
        }

        $pages[] = $this->createPage(1, $this->current == 1);

        if ($sliding_start > 2) {
            $pages[] = $this->createPageEllipsis();
        }

        for ($i = $sliding_start; $i <= $sliding_end; $i++) {
            $pages[] = $this->createPage($i, $i == $this->current);
        }

        if ($sliding_end < $this->pages - 1) {
            $pages[] = $this->createPageEllipsis();
        }

        $pages[] = $this->createPage($this->pages, $this->current == $this->pages);

        return $pages;
    }
38964
public function getPageNumbers()
    {
        $pages = range(1, $this->getPagesCount());

        // And has an styling adapter
        if ($this->getPagesCount() > 10 && $this->hasAdapter()) {
            return $this->style->getPageNumbers($pages, $this->getCurrentPage());
        } else {
            return $pages;
        }
    }
778661
public function getData($page)
    {
        $this->loadData();
        $start = ($page - 1) * $this->pageSize;

        return array_slice($this->filteredData, $start, $this->pageSize);
    }
77660
protected function getPageLinksArray()
    {
        $links = [];
        $types = $this->getPageLinkTypes();

        $links[] = ['name' => Lang::get('backend::lang.pagelist.select_page'), 'url' => false];

        $iterator = function ($links, $level = 0) use (&$iterator) {
            $result = [];
            foreach ($links as $linkUrl => $link) {

                /*
                 * Remove scheme and host from URL
                 */
                $baseUrl = Request::getSchemeAndHttpHost();
                if (strpos($linkUrl, $baseUrl) === 0) {
                    $linkUrl = substr($linkUrl, strlen($baseUrl));
                }

                $linkName = str_repeat('&nbsp;', $level * 4);
                $linkName .= is_array($link) ? array_get($link, 'title', '') : $link;
                $result[] = ['name' => $linkName, 'url' => $linkUrl];

                if (is_array($link)) {
                    $result = array_merge(
                        $result,
                        $iterator(array_get($link, 'links', []), $level + 1)
                    );
                }
            }

            return $result;
        };

        foreach ($types as $typeCode => $typeName) {
            $links = array_merge($links, $iterator($this->getPageLinks($typeCode)));
        }

        return $links;
    }
1093774
public function getPages(){
        // Set method and action
        $method = 'settings';
        $action = 'getPages';

        // Set data
        $data = array(array(1)); // At least one parameter is required by API

        // Send request and retrieve response
        $result = Dispatcher::send($method, $action, $data);

        return $result;
    }
938322
public function getPrevPageUrl()
    {
        if ($this->pageOffset['end'] >= $this->getFilesize() - 1) {
            return false;
        }

        return [
            'file' => $this->file, 'offset' => $this->pageOffset['end']
        ];
    }
1263834
public function PagedComments()
    {
        $list = $this->Comments();

        // Add pagination
        $list = PaginatedList::create($list, Controller::curr()->getRequest());
        $list->setPaginationGetVar('commentsstart' . $this->owner->ID);
        $list->setPageLength($this->owner->getCommentsOption('comments_per_page'));

        $this->owner->extend('updatePagedComments', $list);
        return $list;
    }
195126
public function getData()
	{
		if ($this->usePaginator()) {
			$iterator = (new Paginator($this->getQuery()))->getIterator();

			$data = iterator_to_array($iterator);
		} else {
			$data = $this->getQuery()->getResult();
		}

		$this->onDataLoaded($data);

		return $data;
	}
312781
private function getPagesSeeds()
    {
        return [
            [
                'name'        => 'Pages - List all pages',
                'description' => 'Allow to list all pages.',
                'slug'        => PagesPolicy::PERMISSION_LIST,
            ],
            [
                'name'        => 'Pages - View a page',
                'description' => 'Allow to display a page.',
                'slug'        => PagesPolicy::PERMISSION_SHOW,
            ],
            [
                'name'        => 'Pages - Create a page',
                'description' => 'Allow to create a page.',
                'slug'        => PagesPolicy::PERMISSION_CREATE,
            ],
            [
                'name'        => 'Pages - Update a page',
                'description' => 'Allow to update a page.',
                'slug'        => PagesPolicy::PERMISSION_UPDATE,
            ],
            [
                'name'        => 'Pages - Delete a page',
                'description' => 'Allow to delete a page.',
                'slug'        => PagesPolicy::PERMISSION_DELETE,
            ],
        ];
    }
1091242
public function toArray()
  {
    return [
      'current_page' => $this->current_page,
      'data' => $this->data,
      'first_page_url' => $this->first_page_url,
      'prev_page_url' => $this->prev_page_url,
      'next_page_url' => $this->next_page_url,
      'last_page_url' => $this->last_page_url,
      'per_page' => $this->per_page,
      'total' => $this->total
    ];
  }
142092
protected function getPages(): array
    {
        $pages = [];

        $pages['previous_page'] = $this->pagerfanta->hasPreviousPage() ?
            $this->generateUrl($this->pagerfanta->getPreviousPage()) :
            false;

        $pages['first_page'] = $this->startPage > 1 ? $this->generateUrl(1) : false;
        $pages['mobile_first_page'] = $this->pagerfanta->getCurrentPage() > 2 ? $this->generateUrl(1) : false;

        $pages['second_page'] = $this->startPage === 3 ? $this->generateUrl(2) : false;

        $pages['separator_before'] = $this->startPage > 3;

        $middlePages = [];
        for ($i = $this->startPage, $end = $this->endPage; $i <= $end; ++$i) {
            $middlePages[$i] = $this->generateUrl($i);
        }

        $pages['middle_pages'] = $middlePages;

        $pages['separator_after'] = $this->endPage < $this->pagerfanta->getNbPages() - 2;

        $pages['second_to_last_page'] = $this->endPage === $this->pagerfanta->getNbPages() - 2 ?
            $this->generateUrl($this->pagerfanta->getNbPages() - 1) :
            false;

        $pages['last_page'] = $this->pagerfanta->getNbPages() > $this->endPage ?
            $this->generateUrl($this->pagerfanta->getNbPages()) :
            false;

        $pages['mobile_last_page'] = $this->pagerfanta->getCurrentPage() < $this->pagerfanta->getNbPages() - 1 ?
            $this->generateUrl($this->pagerfanta->getNbPages()) :
            false;

        $pages['next_page'] = $this->pagerfanta->hasNextPage() ?
            $this->generateUrl($this->pagerfanta->getNextPage()) :
            false;

        return $pages;
    }
182106
protected function getPageList() {
		$linkPage = '';
		$linkPage .= $this->replaceLine(1);
		$lastList = floor($this->get('length') / 2);
		$i = 0;
		$length = 0;
		if ($this->pageTotal < $this->get('length') || $this->get('page') - $lastList < 2 || $this->pageTotal - $this->get('length') < 2) {
			$i = 2;
			if ($this->pageTotal <= $this->get('length')) {
				$length = $this->pageTotal - 1;
			} else {
				$length = $this->get('length');
			}
		} elseif ($this->get('page') - $lastList>= 2 && $this->get('page') + $lastList <= $this->pageTotal) {
			$i = $this->get('page')- $lastList;
			$length = $this->get('page') + $lastList- 1;
		} elseif ($this->get('page') + $lastList > $this->pageTotal) {
			$i = $this->pageTotal - $this->get('length') + 1;
			$length = $this->pageTotal - 1;
		}
		if ($this->get('page') > $lastList + 1 && $i > 2) {
			$linkPage .= $this->getOmit();
		}
		for (; $i <= $length; $i ++) {
			$linkPage .= $this->replaceLine($i);
		}
		if ($this->get('page') < $this->pageTotal - $lastList && $length < $this->pageTotal - 1) {
			$linkPage .= $this->getOmit();
		}
		$linkPage .= $this->replaceLine($this->pageTotal);
		return $linkPage;
	}
341153
protected function getListPage()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->page->getList(array('limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('user')) {
            return $this->page->getList(array('user_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('category')) {
            return $this->page->getList(array('category_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('store')) {
            return $this->page->getList(array('store_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->page->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
595278
private function getPages()
    {
        $rootPageId = $this->pluginConfig['urlEntries']['pages']['rootPageId'];
        $rootPage = $this->pageRepository->getPage($rootPageId);

        $cacheIdentifier = md5($rootPageId . '-pagesForSitemap');
        if ($this->cacheInstance->has($cacheIdentifier)) {
            $pages = $this->cacheInstance->get($cacheIdentifier);
        } else {
            $pages = $this->getSubPagesRecursive($rootPageId);
            $this->cacheInstance->set($cacheIdentifier, $pages, ['pagesForSitemap']);
        }

        return array_merge([$rootPage], $pages);
    }
1138558
protected function createPageLinks()
    {
        if (($pageCount = $this->getPageCount()) <= 1) {
            return array();
        }

        list($beginPage, $endPage) = $this->getPageRange();

        $currentPage = $this->getCurrentPage(false); // currentPage is calculated in getPageRange()
        $links = array();

        // first page
        if (!$this->hideFirstAndLast) {
            $links[] = $this->createPageLink($this->firstPageLabel, 0, $currentPage <= 0, false);
        }

        // prev page
        if (($page = $currentPage - 1) < 0) {
            $page = 0;
        }

        $links[] = $this->createPageLink($this->prevPageLabel, $page, $currentPage <= 0, false);

        // internal pages
        for ($i = $beginPage; $i <= $endPage; ++$i) {
            $links[] = $this->createPageLink($i + 1, $i, false, $i == $currentPage);
        }

        // next page
        if (($page = $currentPage + 1) >= $pageCount - 1) {
            $page = $pageCount - 1;
        }

        $links[] = $this->createPageLink($this->nextPageLabel, $page, $currentPage >= $pageCount - 1, false);

        // last page
        if (!$this->hideFirstAndLast) {
            $links[] = $this->createPageLink(
                $this->lastPageLabel,
                $pageCount - 1,
                $currentPage >= $pageCount - 1,
                false
            );
        }

        return $links;
    }
1021405
protected function getPagesArrayText()
    {
        if (empty($this->pages)) {
            return Builder::getArray(array(0 => ''), true);
        }
        $pages = array();
        foreach ($this->pages as $page) {
            $pages[$page->getPageNumber()] = $page->getControl()
                                                  ->getId();
        }
        return Builder::getArray($pages, true);
    }
1051305
public function index(): PaginatedDataInterface
    {
        $builder = $this->createIndexModelBuilder();
        $data    = $this->fetchResources($builder, $builder->getModelClass());

        return $data;
    }