Class Paginator

Summary

Fully Qualified Name: Zend\Paginator\Paginator
Implements: Countable, IteratorAggregate

Description

Methods

Name Description Defined By
__construct() Constructor. Paginator
__toString() Serializes the object as a string. Proxies to {@link render()}. Paginator
clearPageItemCache() Clear the page item cache. Paginator
count() Returns the number of pages. Paginator
getAbsoluteItemNumber() Returns the absolute item number for the specified item. Paginator
getAdapter() Returns the adapter. Paginator
getCurrentItemCount() Returns the number of items for the current page. Paginator
getCurrentItems() Returns the items for the current page. Paginator
getCurrentPageNumber() Returns the current page number. Paginator
getDefaultItemCountPerPage() Get the default item count per page Paginator
getDefaultScrollingStyle() Returns the default scrolling style. Paginator
getFilter() Get the filter Paginator
getItem() Returns an item from a page. The current page is used if there's no page specified. Paginator
getItemCount() Returns the number of items in a collection. Paginator
getItemCountPerPage() Returns the number of items per page. Paginator
getItemsByPage() Returns the items for a given page. Paginator
getIterator() Returns a foreach-compatible iterator. Paginator
getPageItemCache() Returns the page item cache. Paginator
getPageRange() Returns the page range (see property declaration above). Paginator
getPages() Returns the page collection. Paginator
getPagesInRange() Returns a subset of pages within a given range. Paginator
getScrollingStylePluginManager() Returns the scrolling style manager. If it doesn't exist it's created. Paginator
getTotalItemCount() Returns the total number of items available. Paginator
getView() Retrieves the view instance. Paginator
normalizeItemNumber() Brings the item number in range of the page. Paginator
normalizePageNumber() Brings the page number in range of the paginator. Paginator
render() Renders the paginator. Paginator
setCache() Sets a cache object Paginator
setCacheEnabled() Enables/Disables the cache for this instance Paginator
setCurrentPageNumber() Sets the current page number. Paginator
setDefaultItemCountPerPage() Set the default item count per page Paginator
setDefaultScrollingStyle() Sets the default scrolling style. Paginator
setFilter() Set a filter chain Paginator
setGlobalConfig() Set a global config Paginator
setItemCountPerPage() Sets the number of items per page. Paginator
setPageRange() Sets the page range (see property declaration above). Paginator
setScrollingStylePluginManager() Paginator
setView() Sets the view object. Paginator
toJson() Returns the items of the current page as JSON. Paginator

Method Details

__construct()

Constructor.

Parameter Name Type Description
$adapter \AdapterInterface|\AdapterAggregateInterface

Returns:

__toString()

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

Returns: string

clearPageItemCache()

Clear the page item cache.

Parameter Name Type Description
$pageNumber int

Returns: \Paginator

count()

Returns the number of pages.

Returns: int

getAbsoluteItemNumber()

Returns the absolute item number for the specified item.

Parameter Name Type Description
$relativeItemNumber int Relative
$pageNumber int Page

Returns: int

getAdapter()

Returns the adapter.

Returns: \AdapterInterface

getCurrentItemCount()

Returns the number of items for the current page.

Returns: int

getCurrentItems()

Returns the items for the current page.

Returns: \Traversable

getCurrentPageNumber()

Returns the current page number.

Returns: int

getDefaultItemCountPerPage()

Get the default item count per page

Returns: int

getDefaultScrollingStyle()

Returns the default scrolling style.

Returns: string

getFilter()

Get the filter

Returns: \FilterInterface

getItem()

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

Parameter Name Type Description
$itemNumber int Item
$pageNumber int

Returns: mixed

getItemCount()

Returns the number of items in a collection.

Parameter Name Type Description
$items mixed Items

Returns: int

getItemCountPerPage()

Returns the number of items per page.

Returns: int

getItemsByPage()

Returns the items for a given page.

Parameter Name Type Description
$pageNumber int

Returns: mixed

getIterator()

Returns a foreach-compatible iterator.

Returns: \Traversable

getPageItemCache()

Returns the page item cache.

Returns: array

getPageRange()

Returns the page range (see property declaration above).

Returns: int

getPages()

Returns the page collection.

Parameter Name Type Description
$scrollingStyle string Scrolling

Returns: \stdClass

getPagesInRange()

Returns a subset of pages within a given range.

Parameter Name Type Description
$lowerBound int Lower
$upperBound int Upper

Returns: array

getScrollingStylePluginManager()

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

Returns: \ScrollingStylePluginManager

getTotalItemCount()

Returns the total number of items available.

Returns: int

getView()

Retrieves the view instance.

If none registered, instantiates a PhpRenderer instance.

Returns: \Zend\View\Renderer\RendererInterface|null

normalizeItemNumber()

Brings the item number in range of the page.

Parameter Name Type Description
$itemNumber int

Returns: int

normalizePageNumber()

Brings the page number in range of the paginator.

Parameter Name Type Description
$pageNumber int

Returns: int

render()

Renders the paginator.

Parameter Name Type Description
$view \Zend\View\Renderer\RendererInterface

Returns: string

setCache()

Sets a cache object

Parameter Name Type Description
$cache \CacheStorage

Returns:

setCacheEnabled()

Enables/Disables the cache for this instance

Parameter Name Type Description
$enable bool

Returns: \Paginator

setCurrentPageNumber()

Sets the current page number.

Parameter Name Type Description
$pageNumber int Page

Returns: \Paginator $this

setDefaultItemCountPerPage()

Set the default item count per page

Parameter Name Type Description
$count int

Returns:

setDefaultScrollingStyle()

Sets the default scrolling style.

Parameter Name Type Description
$scrollingStyle string

Returns:

setFilter()

Set a filter chain

Parameter Name Type Description
$filter \FilterInterface

Returns: \Paginator

setGlobalConfig()

Set a global config

Parameter Name Type Description
$config array|\Traversable

Returns:

setItemCountPerPage()

Sets the number of items per page.

Parameter Name Type Description
$itemCountPerPage int

Returns: \Paginator $this

setPageRange()

Sets the page range (see property declaration above).

Parameter Name Type Description
$pageRange int

Returns: \Paginator $this

setScrollingStylePluginManager()

Parameter Name Type Description
$scrollingAdapters

Returns: void

setView()

Sets the view object.

Parameter Name Type Description
$view \Zend\View\Renderer\RendererInterface

Returns: \Paginator

toJson()

Returns the items of the current page as JSON.

Returns: string

Top