Returns results for current page

@return array
171721
public function getResults()
    {
        $skip = ($this->page-1)*$this->limit;
        
        $cursor = $this->getCursor();
        $cursor->skip($skip);

        $results = array();
        $i = 0;

        while($cursor->valid() && $cursor->current() && $i++ < $this->limit) {

            $object = new $this->modelName();
            $object->writeAttributes($cursor->current());

            $pseudoCursor = new \stdClass();
            foreach ($object as $key => $value) {
                $pseudoCursor->$key = $value;
            }

            $results[] = $pseudoCursor;
            $cursor->skip();
        }

        return $results;
    }
232108
protected function get_lastpage() {
        $pages = $this->load_all_pages();
        if (count($pages) > 0) {
            foreach ($pages as $page) {
                if ((int)$page->nextpageid === 0) {
                    return $page;
                }
            }
        }
        return false;
    }
242726
public function current()
    {
        if (!$this->page) {
            $this->page = $this->executeCall();
        }

        $this->moreResultsType = isset($this->page['batch']['moreResults'])
            ? $this->page['batch']['moreResults']
            : null;

        return $this->get($this->itemsPath, $this->page);
    }
383560
public static function staticPages()
    {
        if (!getConfig('sitemap.static_pages')) {
            return [];
        }

        return array_map(function (Entity $page) {
            return self::parse(['_name' => 'page', $page->slug], ['lastmod' => $page->modified]);
        }, StaticPage::all());
    }
342866
public function current()
    {
        $page = $this->pageIterator->current();

        return isset($page[$this->pageIndex])
            ? $page[$this->pageIndex]
            : null;
    }
839064
public function getPages(): array
    {
        if ($this->_pages !== null) {
            return $this->_pages;
        }

        $this->_pages = [];
        $pages = explode('<!--pagebreak-->', (string)$this);

        foreach ($pages as $page) {
            $this->_pages[] = new \Twig_Markup($page, Craft::$app->charset);
        }

        return $this->_pages;
    }
905058
public function getPagesRoutes()
    {
        $qb = $this->createQueryBuilder('p');

        $results = $qb
            ->select('p.route')
            ->getQuery()
            ->getScalarResult();

        return array_column($results, 'route');
    }
491661
public function getPagination(): array
    {
        if ($this->pagination === null) {
            $this->pagination = $this->setPagination();
        }

        return $this->pagination;
    }
1030173
public function findPage()
    {
        $data['data'] = $this->findAll();
        $data['data_count'] = $this->conn()->selectCollection($this->table_name)->count();

        return $data;
    }
815820
public function getCurrentPageAncestry()
    {
        $ancestry = ViewTools::singleton()->convertClass(
            ClassTools::singleton()->getObjectAncestry($this->getCurrentPageClass(), Page::class, true)
        );
        
        return ViewTools::singleton()->array2att($ancestry);
    }
847415
function current()
    {
        if (!isset($this->_curPage)
            || $this->_curPage->getPage() != $this->_position
        ) {
            $this->_curPage = $this->_pages->get($this->_position);
        }
        return $this->_curPage;
    }
582201
public function getSearchResults()
    {
        $query = $this->getSearchQuery();

        $search = new DocumentationSearch();
        $search->setQuery($query);
        $search->setVersions($this->getSearchedVersions());
        $search->setModules($this->getSearchedEntities());
        $search->setOutputController($this->owner);
        
        return $search->renderResults();
    }
152063
public function getAll()
    {
        $all   = [];
        $pages = $this->getPages();

        if ($this->getFirst() !== null) {
            $all[$this->getFirst()] = Pagination::FIRST;
        }

        if ($this->getLess() !== null) {
            $all[$this->getLess()] = Pagination::LESS;
        }

        foreach ($pages as $k => $page) {
            $all[$k] = $page;
        }

        if ($this->getMore() !== null) {
            $all[$this->getMore()] = Pagination::MORE;
        }

        if ($this->getLast() !== null) {
            $all[$this->getLast()] = Pagination::LAST;
        }

        ksort($all);

        return $all;
    }
1344459
public function getCurrentPageInfo()
    {
        $result = array(
            'handle' => $this->getCurrentPage()
        );
        
        if (Mage::registry('current_category') instanceof Mage_Catalog_Model_Category) {
            $result['category'] = Mage::registry('current_category')->getId();
        }

        if (Mage::registry('current_product') instanceof Mage_Catalog_Model_Product) {
            $result['product'] = Mage::registry('current_product')->getId();
        }
        
        return $result;
    }
704718
private function getFromTo(): array
    {
        if ($this->count < $this->perPage || $this->perPage === null) {
            $start = 1;
            $end = $this->count;
        } else {
            if ($this->hasMorePages()) {
                $end = $this->perPage * $this->currentPage;
                $start = ($end - $this->perPage) + 1;
            } else {
                $endTest = $this->perPage * $this->currentPage;
                $start = ($endTest - $this->perPage) + 1;

                $end = $start + $this->getCountOnLastPage();
            }
        }

        return ['from' => $start, 'to' => $end];
    }
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;
    }
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
    ];
  }