Get a list of pages

@return  array   Returns and array of pages information
962555
protected function _pages()
    {
        $pages = new AnConfig();
        $current  = ($this->current - 1) * $this->limit;
        
        // First
        $page    = 1;
        $offset  = 0;
        $active  = $offset != $this->offset;
        
        $pages->first = array(
            'title' => 'First', 
            'page' => 1, 
            'offset' => $offset, 
            'limit' => $this->limit, 
            'current' => false, 
            'active' => $active, 
            'rel' => 'first'
        );
      
        // Previous
        $offset  = max(0, ($this->current - 2) * $this->limit);
        $active  = $offset != $this->offset;
        $pages->prev = array(
            'title' => 'Prev', 
            'page' => $this->current - 1, 
            'offset' => $offset, 
            'limit' => $this->limit, 
            'current' => false, 
            'active' => $active, 
            'rel' => 'prev'
        );

        // Pages
        $offsets = array();
        foreach ($this->_offsets() as $page => $offset) {
            $current = $offset == $this->offset;
            $offsets[] = array(
                'title' => $page, 
                'page' => $page, 
                'offset' => $offset, 
                'limit' => $this->limit, 
                'current' => $current, 
                'active' => !$current
            );
        }
        
        $pages->offsets = $offsets;
        
        // Next
        $offset = min(($this->count-1) * $this->limit, ($this->current) * $this->limit);
        $active = $offset != $this->offset;
        $pages->next = array(
            'title' => 'Next', 
            'page' => $this->current + 1, 
            'offset' => $offset, 
            'limit' => $this->limit, 
            'current' => false, 
            'active' => $active, 
            'rel' => 'next'
        );
       
        // Last
        $offset  = ($this->count - 1) * $this->limit;
        $active  = $offset != $this->offset;
        $pages->last = array(
            'title' => 'Last', 
            'page' => $this->count, 
            'offset' => $offset, 
            'limit' => $this->limit, 
            'current' => false, 
            'active' => $active, 
            'rel' => 'last'
        );
        
        return $pages;
    }
759750
protected function getPidList(): array
    {
        $rootPIDs = explode(',', $this->settings['pages']);
        $pidList = $rootPIDs;

        // iterate through root-page ids and merge to array
        foreach ($rootPIDs as $pid) {
            $result = $this->queryGenerator->getTreeList($pid, $this->settings['recursive'], 0, 1);
            if ($result) {
                $subtreePids = explode(',', $result);
                $pidList = array_merge($pidList, $subtreePids);
            }
        }
        return $pidList;
    }
11472
public function getFilteredPages()
    {
        $pages = Versioned::get_including_deleted(SiteTree::class);
        $pages = $this->applyDefaultFilters($pages);

        $pages = $pages->filterByCallback(function (SiteTree $page) {
            // Doesn't exist on either stage or live
            return $page->isArchived();
        });
        return $pages;
    }
693143
public function getFacebookPages()
    {
        // Returns null if they haven't connected to Facebook
        if ($this->isConnectedToFacebook() !== true) {
            return null;
        }

        $response = Facebook::load()->get('/me/accounts', $this->data('access_token'));
        
        $chunks = [];
        $edges = [];

        // Load data through pagination
        for ($i = 0; $i <= 100; $i++) {
            if ($i === 0) {
                $edges[0] = $response->getGraphEdge();
            } else {
                $edges[$i] = Facebook::load()->next($edges[$i-1]);
            }

            $metaData = $edges[$i]->getMetaData();
            
            $chunks[$i] = $edges[$i]->asArray();

            if ( ! isset($metaData['paging']['next'])) {
                break;
            }
        }

        $pages = [];
        foreach ($chunks as $chunk) {
            foreach ($chunk as $page) {
                $pages[$page['id']] = $page;
            }
        }
        
        // Returns the list of pages.
        return collect($pages);
    }
655320
public static function fetchAllPagesPageTypes()
    {
        $types = Symphony::Database()->fetch("SELECT `page_id`,`type` FROM `tbl_pages_types`");
        $page_types = array();

        if (is_array($types)) {
            foreach ($types as $type) {
                $page_types[$type['page_id']][] = $type['type'];
            }
        }

        return $page_types;
    }
368543
public List<Page> getPages() {
        Collection collection = collections.get("page");
        if (collection != null) {
            List<Page> pages = collection.getPages();
            return ImmutableList.copyOf(pages);
        }
        return Collections.emptyList();
    }
1107659
public function getList()
    {
        /** @var RcmUserService $rcmUserService */
        $rcmUserService = $this->serviceLocator->get(RcmUserService::class);

        //ACCESS CHECK
        if (!$rcmUserService->isAllowed(
            ResourceName::RESOURCE_SITES,
            'admin'
        )
        ) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);
            return $this->getResponse();
        }

        $config = $this->getConfig();

        $pageTypes = $config['Rcm']['pageTypes'];

        return new ApiJsonModel($pageTypes, 0, 'Success');
    }
825666
public function getFilteredPages()
    {
        $pages = Versioned::get_by_stage(SiteTree::class, 'Stage');
        $pages = $this->applyDefaultFilters($pages);
        $pages = $pages->filterByCallback(function (SiteTree $page) {
            // If page exists on stage but not on live
            return $page->isOnDraftOnly();
        });
        return $pages;
    }
642990
protected function getPageTypes()
    {
        $pageTypes = array();
        foreach (SiteTree::page_type_classes() as $pageTypeClass) {
            $pageTypes[$pageTypeClass] = SiteTree::singleton($pageTypeClass)->i18n_singular_name();
        }
        asort($pageTypes);
        return $pageTypes;
    }
152193
public function index()
    {
        $categories = $this->PagesCategories->find()
            ->contain(['Parents' => ['fields' => ['title']]])
            ->order([sprintf('%s.lft', $this->PagesCategories->getAlias()) => 'ASC'])
            ->formatResults(function (ResultSet $results) {
                //Gets categories as tree list
                $treeList = $this->PagesCategories->getTreeList()->toArray();

                return $results->map(function (PagesCategory $category) use ($treeList) {
                    return $category->set('title', $treeList[$category->id]);
                });
            });

        $this->set(compact('categories'));
    }
1281263
protected function getItems()
    {
        $list = $this->DataSource->getItems($this->pagesize * ($this->currentpage - 1), $this->getPageSize(), $this->sortf, $this->sortd);
        $this->pagerowscount = count($list);
        return is_array($list) ? $list : array();
    }
298482
public function getPageNameList()
    {
        if (!empty($this->arPageNameList)) {
            return $this->arPageNameList;
        }

        $arResult = [];

        //Get page list
        $obPageList = $this->getPageList();
        if (empty($obPageList)) {
            return $arResult;
        }

        //Process page list
        foreach ($obPageList as $obPage) {
            $arResult[$obPage->id] = $obPage->title;
        }

        $this->arPageNameList = $arResult;

        return $arResult;
    }
153149
public function getCollectionList()
    {
        $cArray = [];
        $bID = $this->getBlockID();
        if ($bID) {
            $db = Loader::db();
            $q = 'select DISTINCT Pages.cID from CollectionVersionBlocks inner join Pages on (CollectionVersionBlocks.cID = Pages.cID) inner join CollectionVersions on (CollectionVersions.cID = Pages.cID) where CollectionVersionBlocks.bID = ?';
            $r = $db->query($q, [$bID]);
            if ($r) {
                while ($row = $r->fetchRow()) {
                    $cArray[] = Page::getByID($row['cID'], 'RECENT');
                }
                $r->free();
            }
        }

        return $cArray;
    }
753544
protected function _getCurrentPages()
    {
        $ret = array();
        $p = $this->getData()->getPage();
        while ($p) {
            $ret[] = $p;
            $p = $p->getParentPage();
        }
        return $ret;
    }
927730
public function info()
    {
        $this->logger->debug('Page:info');
        if (!$this->setIdentifier('', 's')) {
            return [];
        }
        $this->setParam('prop', 'pageprops');
        $this->send();
        return Tools::flatten($this->getResponse(['query', 'pages']));
    }
153126
public @NotNull List<Page> getPages() {
    return getPages((Predicate<Page>)null, (Page)null);
  }
621079
public function getPages()
	{
		if($this->_pages===null)
			$this->_pages=$this->createPages();
		return $this->_pages;
	}