category Zend
package Zend_Paginator

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

Returns

integer

Returns the absolute item number for the specified item.

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

Parameters

$relativeItemNumber

integer

Relative item number

$pageNumber

integer

Page number

Returns

integer

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() : 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(integer $itemNumber, integer $pageNumber) : mixed

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

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) : array

Parameters

$scrollingStyle

string

Scrolling style

Returns

array

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.

getScrollingStylePluginManager() : \Zend\Paginator\ScrollingStylePluginManager

If it doesn't exist it's created.

Returns

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

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) : 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(integer $pageNumber) : \Zend\Paginator\Paginator

Parameters

$pageNumber

integer

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(integer $itemCountPerPage) : \Zend\Paginator\Paginator

Parameters

$itemCountPerPage

integer

Returns

Sets the page range (see property declaration above).

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

Parameters

$pageRange

integer

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

Returns

integer

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

 

Current page items

$currentItems : \Traversable

 

Current page number (starting from 1)

$currentPageNumber : integer

 

Default item count per page

$defaultItemCountPerPage : int

 

Default scrolling style

$defaultScrollingStyle : string

 

Result filter

$filter : \Zend\Filter\FilterInterface

 

Number of items per page

$itemCountPerPage : integer

 

Number of pages

$pageCount : integer

 

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

$pageRange : integer

 

Pages

$pages : array

 

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