package Default

 Methods

Constructor.

__construct(\Zend\Paginator\Adapter\AdapterInterface|\Zend\Paginator\AdapterAggregateInterface $adapter) 

Parameters

$adapter

\Zend\Paginator\Adapter\AdapterInterface\Zend\Paginator\AdapterAggregateInterface

Exceptions

\Zend\Paginator\Exception\InvalidArgumentException

Serializes the object as a string. Proxies to {@link render()}.

__toString() : string

Returns

string

Clear the page item cache.

clearPageItemCache(integer $pageNumber = null) : \Zend\Paginator\Paginator

Parameters

$pageNumber

integer

Returns

\Zend\Paginator\Paginator

Returns the number of pages.

count() : integer

Returns

integer

Returns the absolute item number for the specified item.

getAbsoluteItemNumber(integer $relativeItemNumber, integer $pageNumber = null) : integer

Parameters

$relativeItemNumber

integer

Relative item number

$pageNumber

integer

Page number

Returns

integer

Returns the adapter.

getAdapter() : \Zend\Paginator\Adapter\AdapterInterface

Returns

\Zend\Paginator\Adapter\AdapterInterface

Returns the number of items for the current page.

getCurrentItemCount() : integer

Returns

integer

Returns the items for the current page.

getCurrentItems() : \Traversable

Returns

\Traversable

Returns the current page number.

getCurrentPageNumber() : integer

Returns

integer

Get the default item count per page

getDefaultItemCountPerPage() : integer
Static

Returns

integer

Returns the default scrolling style.

getDefaultScrollingStyle() : string
Static

Returns

string

Get the filter

getFilter() : \Zend\Filter\FilterInterface

Returns

\Zend\Filter\FilterInterface

Returns an item from a page. The current page is used if there's no page specified.

getItem(integer $itemNumber, integer $pageNumber = null) : mixed

Parameters

$itemNumber

integer

Item number (1 to itemCountPerPage)

$pageNumber

integer

Exceptions

\Zend\Paginator\Exception\InvalidArgumentException

Returns

mixed

Returns the number of items in a collection.

getItemCount(mixed $items) : integer

Parameters

$items

mixed

Items

Returns

integer

Returns the number of items per page.

getItemCountPerPage() : integer

Returns

integer

Returns the items for a given page.

getItemsByPage(integer $pageNumber) : mixed

Parameters

$pageNumber

integer

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() : integer

Returns

integer

Returns the page collection.

getPages(string $scrollingStyle = null) : \stdClass

Parameters

$scrollingStyle

string

Scrolling style

Returns

\stdClass

Returns a subset of pages within a given range.

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

Parameters

$lowerBound

integer

Lower bound of the range

$upperBound

integer

Upper bound of the range

Returns

array

Returns the scrolling style manager. If it doesn't exist it's created.

getScrollingStylePluginManager() : \Zend\Paginator\ScrollingStylePluginManager
Static

Returns

\Zend\Paginator\ScrollingStylePluginManager

Returns the total number of items available.

getTotalItemCount() : integer

Returns

integer

Retrieves the view instance.

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

If none registered, instantiates a PhpRenderer instance.

Returns

\Zend\View\Renderer\RendererInterfacenull

Brings the item number in range of the page.

normalizeItemNumber(integer $itemNumber) : integer

Parameters

$itemNumber

integer

Returns

integer

Brings the page number in range of the paginator.

normalizePageNumber(integer $pageNumber) : integer

Parameters

$pageNumber

integer

Returns

integer

Renders the paginator.

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

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

string

Sets a cache object

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

Parameters

$cache

\Zend\Cache\Storage\StorageInterface

Enables/Disables the cache for this instance

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

Parameters

$enable

boolean

Returns

\Zend\Paginator\Paginator

Sets the current page number.

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

Parameters

$pageNumber

integer

Page number

Returns

\Zend\Paginator\Paginator$this

Set the default item count per page

setDefaultItemCountPerPage(integer $count) 
Static

Parameters

$count

integer

Sets the default scrolling style.

setDefaultScrollingStyle(string $scrollingStyle = 'Sliding'
Static

Parameters

$scrollingStyle

string

Set a filter chain

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

Parameters

$filter

\Zend\Filter\FilterInterface

Returns

\Zend\Paginator\Paginator

Set a global config

setGlobalConfig(array|\Traversable $config) 
Static

Parameters

$config

array\Traversable

Exceptions

\Zend\Paginator\Exception\InvalidArgumentException

Sets the number of items per page.

setItemCountPerPage(integer $itemCountPerPage = -1) : \Zend\Paginator\Paginator

Parameters

$itemCountPerPage

integer

Returns

\Zend\Paginator\Paginator$this

Sets the page range (see property declaration above).

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

Parameters

$pageRange

integer

Returns

\Zend\Paginator\Paginator$this

setScrollingStylePluginManager()

setScrollingStylePluginManager($scrollingAdapters) 
Static

Parameters

$scrollingAdapters

Sets the view object.

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

Parameters

$view

\Zend\View\Renderer\RendererInterface

Returns

\Zend\Paginator\Paginator

Returns the items of the current page as JSON.

toJson() : string

Returns

string

Calculates the page count.

_calculatePageCount() : integer

Returns

integer

Creates the page collection.

_createPages(string $scrollingStyle = null) : \stdClass

Parameters

$scrollingStyle

string

Scrolling style

Returns

\stdClass

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

_getCacheId(integer $page = null) : string

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

Parameters

$page

integer

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 = null) : \Zend\Paginator\ScrollingStyle\ScrollingStyleInterface

Parameters

$scrollingStyle

string

Exceptions

\Zend\Paginator\Exception\InvalidArgumentException

Returns

\Zend\Paginator\ScrollingStyle\ScrollingStyleInterface

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

cacheEnabled() : boolean

Returns

boolean

 Properties

 

Adapter

$adapter : \Zend\Paginator\Adapter\AdapterInterface

Default

null
 

Adapter plugin manager

$adapters : \Zend\Paginator\AdapterPluginManager

Default

null
Static
 

Cache object

$cache : \Zend\Cache\Storage\StorageInterface

Default

Static
 

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

$cacheEnabled : boolean

Default

true
 

Configuration file

$config : array | null

Default

null
Static
 

Number of items in the current page

$currentItemCount : integer

Default

null
 

Current page items

$currentItems : \Traversable

Default

null
 

Current page number (starting from 1)

$currentPageNumber : integer

Default

1
 

Default item count per page

$defaultItemCountPerPage : integer

Default

10
Static
 

Default scrolling style

$defaultScrollingStyle : string

Default

'Sliding'
Static
 

Result filter

$filter : \Zend\Filter\FilterInterface

Default

null
 

Number of items per page

$itemCountPerPage : integer

Default

null
 

Number of pages

$pageCount : integer

Default

null
 

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

$pageRange : integer

Default

10
 

Pages

$pages : \stdClass

Default

null
 

Scrolling style plugin manager

$scrollingStyles : \Zend\Paginator\ScrollingStylePluginManager

Default

null
Static
 

View instance used for self rendering

$view : \Zend\View\Renderer\RendererInterface

Default

null

 Constants

 

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

CACHE_TAG_PREFIX = 'Zend_Paginator_'