Methods

Serializes the object as a string.

__toString() : string

Proxies to render().

Returns

string

Clear the page item cache.

clearPageItemCache(int $pageNumber) : \Zend\Paginator\Paginator

Parameters

$pageNumber

int

Returns

Returns the number of pages.

count() : int

Returns

int

Returns the absolute item number for the specified item.

getAbsoluteItemNumber(int $relativeItemNumber, int $pageNumber) : int

Parameters

$relativeItemNumber

int

Relative item number

$pageNumber

int

Page number

Returns

int

Returns the number of items for the current page.

getCurrentItemCount() : int

Returns

int

Returns the items for the current page.

getCurrentItems() : \Traversable

Returns

\Traversable

Returns the current page number.

getCurrentPageNumber() : int

Returns

int

Get the default item count per page

getDefaultItemCountPerPage() : int

Returns

int

Returns the default scrolling style.

getDefaultScrollingStyle() : string

Returns

string

Get the filter

getFilter() : \Zend\Filter\FilterInterface

Returns an item from a page.

getItem(int $itemNumber, int $pageNumber) : mixed

The current page is used if there's no page specified.

Parameters

$itemNumber

int

Item number (1 to itemCountPerPage)

$pageNumber

int

Exceptions

\Zend\Paginator\Exception\InvalidArgumentException

Returns

mixed

Returns the number of items in a collection.

getItemCount(mixed $items) : int

Parameters

$items

mixed

Items

Returns

int

Returns the number of items per page.

getItemCountPerPage() : int

Returns

int

Returns the items for a given page.

getItemsByPage(int $pageNumber) : mixed

Parameters

$pageNumber

int

Returns

mixed

Returns a foreach-compatible iterator.

getIterator() : \Traversable

Exceptions

\Zend\Paginator\Exception\RuntimeException

Returns

\Traversable

Returns the page item cache.

getPageItemCache() : array

Returns

array

Returns the page range (see property declaration above).

getPageRange() : int

Returns

int

Returns the page collection.

getPages(string $scrollingStyle) : \stdClass

Parameters

$scrollingStyle

string

Scrolling style

Returns

Returns a subset of pages within a given range.

getPagesInRange(int $lowerBound, int $upperBound) : array

Parameters

$lowerBound

int

Lower bound of the range

$upperBound

int

Upper bound of the range

Returns

array

Returns the scrolling style manager.

getScrollingStylePluginManager() : \Zend\Paginator\ScrollingStylePluginManager

If it doesn't exist it's created.

Returns

Returns the total number of items available.

getTotalItemCount() : int

Returns

int

Retrieves the view instance.

getView() : \Zend\View\Renderer\RendererInterface | null

If none registered, instantiates a PhpRenderer instance.

Returns

Brings the item number in range of the page.

normalizeItemNumber(int $itemNumber) : int

Parameters

$itemNumber

int

Returns

int

Brings the page number in range of the paginator.

normalizePageNumber(int $pageNumber) : int

Parameters

$pageNumber

int

Returns

int

Renders the paginator.

render(\Zend\View\Renderer\RendererInterface $view) : string

Parameters

Returns

string

Sets a cache object

setCache(\Zend\Cache\Storage\StorageInterface $cache) 

Enables/Disables the cache for this instance

setCacheEnabled(bool $enable) : \Zend\Paginator\Paginator

Parameters

$enable

bool

Returns

Sets the current page number.

setCurrentPageNumber(int $pageNumber) : \Zend\Paginator\Paginator

Parameters

$pageNumber

int

Page number

Returns

Set the default item count per page

setDefaultItemCountPerPage(int $count) 

Parameters

$count

int

Sets the default scrolling style.

setDefaultScrollingStyle(string $scrollingStyle) 

Parameters

$scrollingStyle

string

Set a filter chain

setFilter(\Zend\Filter\FilterInterface $filter) : \Zend\Paginator\Paginator

Set a global config

setGlobalConfig(array | \Traversable $config) 

Parameters

$config

array\Traversable

Exceptions

\Zend\Paginator\Exception\InvalidArgumentException

Sets the number of items per page.

setItemCountPerPage(int $itemCountPerPage) : \Zend\Paginator\Paginator

Parameters

$itemCountPerPage

int

Returns

Sets the page range (see property declaration above).

setPageRange(int $pageRange) : \Zend\Paginator\Paginator

Parameters

$pageRange

int

Returns

setScrollingStylePluginManager()

setScrollingStylePluginManager($scrollingAdapters) 

Parameters

$scrollingAdapters

Sets the view object.

setView(\Zend\View\Renderer\RendererInterface $view) : \Zend\Paginator\Paginator

Returns the items of the current page as JSON.

toJson() : string

Returns

string

Calculates the page count.

_calculatePageCount() : int

Returns

int

Creates the page collection.

_createPages(string $scrollingStyle) : \stdClass

Parameters

$scrollingStyle

string

Scrolling style

Returns

Makes an Id for the cache Depends on the adapter object and the page number

_getCacheId(int $page) : string

Used to store item in cache from that Paginator instance and that current page

Parameters

$page

int

Returns

string

Get the internal cache id Depends on the adapter and the item count per page

_getCacheInternalId() : string

Used to tag that unique Paginator instance in cache

Returns

string

Loads a scrolling style.

_loadScrollingStyle(string $scrollingStyle) : \Zend\Paginator\ScrollingStyle\ScrollingStyleInterface

Tells if there is an active cache object and if the cache has not been disabled

cacheEnabled() : bool

Returns

bool

 Properties

   

Adapter plugin manager

$adapters : \Zend\Paginator\AdapterPluginManager

 

Cache object

$cache : \Zend\Cache\Storage\StorageInterface

 

Enable or disable the cache by Zend\Paginator\Paginator instance

$cacheEnabled : bool

 

Configuration file

$config : array | null

 

Number of items in the current page

$currentItemCount : int

 

Current page items

$currentItems : \Traversable

 

Current page number (starting from 1)

$currentPageNumber : int

 

Default item count per page

$defaultItemCountPerPage : int

 

Default scrolling style

$defaultScrollingStyle : string

 

Result filter

$filter : \Zend\Filter\FilterInterface

 

Number of items per page

$itemCountPerPage : int

 

Number of pages

$pageCount : int

 

Number of local pages (i.e., the number of discrete page numbers that will be displayed, including the current page number)

$pageRange : int

 

Pages

$pages : \stdClass

 

Scrolling style plugin manager

$scrollingStyles : \Zend\Paginator\ScrollingStylePluginManager

 

View instance used for self rendering

$view : \Zend\View\Renderer\RendererInterface

 Constants

 

The cache tag prefix used to namespace Paginator results in the cache

CACHE_TAG_PREFIX