Gets items of this page as well as the 1-st item from the next page.
Doing it this way keeps us from having to run the expensive total item
count query in some scenarios.

@return array
320680
private function getItemsWithOneExtra()
    {
        if (null === $this->itemsWithOneExtra) {
            $this->itemsWithOneExtra = $this
                ->adapter
                ->getItems($this->getOffset(), $this->getLength() + 1)
            ;
        }

        return $this->itemsWithOneExtra;
    }
905307
public function getItemsRaw() {
        $itemsRaw = $this->_getItemsRaw();
        if (null !== $this->_pageSize && count($itemsRaw) > $this->_pageSize) {
            $itemsRaw = array_slice($itemsRaw, 0, $this->_pageSize);
        }
        return $itemsRaw;
    }
1279043
public function get()
    {
        $list      = [];
        $i         = 0;
        $realLimit = $this->offset && $this->limit
            ? $this->offset + $this->limit
            : $this->limit;

        foreach ($this->getData() as &$rs) {
            if ($this->offset && $this->offset > $i) {
                $i++;
                continue;
            }

            if ($realLimit && $realLimit == $i) {
                break;
            }

            if (!$this->where) {
                $list[] = $this->convertItem($rs);
                $i++;
                continue;
            }

            if ($this->matchWhere($rs)) {
                $list[] = $this->convertItem($rs);
                $i++;
            }
        }

        return $list;
    }
593399
protected function collectItems()
    {
        $items = [];

        foreach ($this->_layout as $row => $unused) {
            foreach ($this->_layout[$row] as $column => $item) {
                $items[] = $item;
            }
        }

        return $items;
    }
466664
protected function getPaginationData()
	{
		// Choose page range ( window ) and set start/end page range.
		$this->setPageRange();

		// Set previous/next page number.
		$this->setPrevNumPage();
		$this->setNextNumPage();

		$pagination['template']		= $this->layout_template;
		$pagination['items_total'] 	= $this->getNumTotalResults();
		$pagination['item_start']		= ( ( $this->prev_num_page * $this->items_per_page ) + 1 );
		$pagination['item_end']		= ( $this->current_page_number * $this->items_per_page );
		$pagination['params']			= $this->params_template;
		if ( $pagination['item_end'] > $this->getNumTotalResults() )
		{
			$pagination['item_end'] = $this->getNumTotalResults();
		}
		$pagination['num_pages']		= $this->num_pages;
		$pagination['current_page']	= $this->current_page_number;

		// Links.
		for ( $i = $this->start_page_range; $i<= $this->end_page_range; $i++ )
		{
			$pagination['pages'][$i]['number']		= (int)$i;
		 	$pagination['pages'][$i]['is_current'] 	= ( $i == $this->current_page_number );

		 	$pagination['pages'][$i]['link'] 		= $this->url_base;
		 	if ( 1 != $i )
		 	{
		 		$pagination['pages'][$i]['link'] 	= $this->url_base . $this->separator_link_page . $i;
		 	}

		}

		if ( $this->prev_num_page > 0 )
		{
			$pagination['previous_page']['number'] 	= $this->prev_num_page;

			$pagination['previous_page']['link'] 		= $this->url_base;
			if ( 1 != $this->prev_num_page )
			{
				$pagination['previous_page']['link'] = $this->url_base . $this->separator_link_page . $this->prev_num_page;
			}
		}

		if ( $this->next_num_page > 0 )
		{
			$pagination['next_page']['number'] 		= $this->next_num_page;
			$pagination['next_page']['link'] 			= $this->url_base . $this->separator_link_page . $this->next_num_page;;
		}

		if ( 1 != $this->current_page_number )
		{
			$pagination['first_page']['number'] 		= 1;
			$pagination['first_page']['link'] 		= $this->url_base;
		}

		if ( $this->num_pages != $this->current_page_number )
		{
			$pagination['last_page']['number']	 	= $this->num_pages;
			$pagination['last_page']['link'] 			= $this->url_base . $this->separator_link_page . $this->num_pages;
		}

		$pagination['items_per_page'] 		= $this->items_per_page;
		$pagination['display_items_per_page'] = $this->display_items_per_page;

		return $pagination;
	}
11505
public function getNext()
    {
        if (count($this->pagination) == 0) {
            $this->get();
        }
        
        if ($this->page < $this->pagination['total_pages']) {
            $this->page++;
            return $this->get();
        }
        
        return false;
    }
273935
public function getListItems()
    {
        // Create List:
        
        $items = ArrayList::create();
        
        // Obtain Items from Source:
        
        if ($source = $this->owner->getSource()) {
            
            // Obtain Source List:
            
            $list = $source->getListItems();
            
            // Filter List Items (if applicable):
            
            if (in_array(ListFilter::class, class_uses($source))) {
                
                if ($where = $source->getListWhere()) {
                    $list = $list->where($where);
                }
                
                foreach ($source->getListFilters() as $filter) {
                    $list = $list->filter($filter);
                }
                
            }
            
            // Merge List Items:
            
            $items->merge($list);
            
        }
        
        // Sort Items (if applicable):
        
        if ($this->owner->SortItemsBy) {
            $items = $this->sort($items);
        }
        
        // Remove Items without Images (if applicable):
        
        if ($this->owner->ImageItems) {
            
            $items = $items->filterByCallback(function ($item) {
                return $item->hasMetaImage();
            });
            
        }
        
        // Reverse Items (if applicable):
        
        if ($this->owner->ReverseItems) {
            $items = $items->reverse();
        }
        
        // Limit Items (if applicable):
        
        if ($limit = $this->owner->NumberOfItems) {
            $items = $items->limit($limit);
        }
        
        // Paginate Items (if applicable):
        
        if ($this->owner->PaginateItems && $this->owner->SortItemsBy != self::SORT_RANDOM) {
            
            $items = PaginatedList::create($items, $this->getRequest());
            
            $items->setPaginationGetVar($this->owner->getPaginationGetVar());
            
            if ($this->owner->ItemsPerPage) {
                $items->setPageLength($this->owner->ItemsPerPage);
            }
            
        }
        
        // Associate Items with Rendering Component:
        
        foreach ($items as $item) {
            $item->setRenderer($this->owner);
        }
        
        // Answer List:
        
        return $items;
    }
1042277
protected function getListPage()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        $list = (array) $this->page->getList($conditions);
        $this->prepareListPage($list);
        return $list;
    }
738042
public function getItems()
    {
        if ($this->items === null) {
            $fusionContext = $this->runtime->getCurrentContext();
            $this->currentNode = isset($fusionContext['activeNode']) ? $fusionContext['activeNode'] : $fusionContext['documentNode'];
            $this->currentLevel = 1;
            $this->items = $this->buildItems();
        }

        return $this->items;
    }
1021675
public function getData()
    {
        $limit = $this->getLimit();
        $this->setHeaders();
        $page  = $this->getPage();
        if ($page > 0) {
            $page-=1;
        }
        return $this->getDataSource()->limit($limit)->offset($limit * $page)->getAll();
    }
30028
protected function fetchData()
	{
		if(($sort=$this->getSort())!==false && ($order=$sort->getOrderBy())!='')
			$this->sortData($this->getSortDirections($order));

		if(($pagination=$this->getPagination())!==false)
		{
			$pagination->setItemCount($this->getTotalItemCount());
			return array_slice($this->rawData, $pagination->getOffset(), $pagination->getLimit());
		}
		else
			return $this->rawData;
	}
1149005
public function getItemsArray()
    {
        $items = [];

        foreach ($this->getItems() as $item) {
            $items[] = [
                'id'   => $item->getId(),
                'text' => $item->getText(),
            ];
        }

        return $items;
    }
628741
public function getLastPage()
    {
        $perPage = max($this->paginatedResult->getQuery()->getItemsPerPage(), 1);
        $total = $this->getTotal();
        $pageCount = $total / $perPage;

        if (round($pageCount, 1) - round($pageCount, 0) > 0) {
            return round($pageCount, 0) + 1;
        }

        return round($pageCount, 0);
    }
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;
    }
598157
public function getPages()
    {
        $pages = array();

        foreach ($this->children as $child) {
            if ($child instanceof SwatNoteBookChild) {
                $pages = array_merge($pages, $child->getPages());
            }
        }

        return $pages;
    }
147466
public function getPages()
    {
        $pages = $this->getMaxPages();
        $tmp = $this->page - floor($pages / 2);
        $begin = $tmp > $this->getFirstPage() ? $tmp : $this->getFirstPage();
        $end = min($begin + $pages - 1, $this->getLastPage());

        return range($begin, $end, 1);
    }
866179
public function toExtendedArray()
    {
        $items  = [];
        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);

            if ($page !== null) {
                $items[$page->route()] = $page->toArray();
            }
        }
        return $items;
    }