Zend Framework
3.0
|
Public Member Functions | |
__construct ($adapter) | |
Constructor. | |
__toString () | |
Serializes the object as a string. | |
setCacheEnabled ($enable) | |
Enables/Disables the cache for this instance. | |
count () | |
Returns the number of pages. | |
getTotalItemCount () | |
Returns the total number of items available. | |
clearPageItemCache ($pageNumber=null) | |
Clear the page item cache. | |
getAbsoluteItemNumber ($relativeItemNumber, $pageNumber=null) | |
Returns the absolute item number for the specified item. | |
getAdapter () | |
Returns the adapter. | |
getCurrentItemCount () | |
Returns the number of items for the current page. | |
getCurrentItems () | |
Returns the items for the current page. | |
getCurrentPageNumber () | |
Returns the current page number. | |
setCurrentPageNumber ($pageNumber) | |
Sets the current page number. | |
getFilter () | |
Get the filter. | |
setFilter (FilterInterface $filter) | |
Set a filter chain. | |
getItem ($itemNumber, $pageNumber=null) | |
Returns an item from a page. | |
getItemCountPerPage () | |
Returns the number of items per page. | |
setItemCountPerPage ($itemCountPerPage=-1) | |
Sets the number of items per page. | |
getItemCount ($items) | |
Returns the number of items in a collection. | |
getItemsByPage ($pageNumber) | |
Returns the items for a given page. | |
getIterator () | |
Returns a foreach-compatible iterator. | |
getPageRange () | |
Returns the page range (see property declaration above). | |
setPageRange ($pageRange) | |
Sets the page range (see property declaration above). | |
getPages ($scrollingStyle=null) | |
Returns the page collection. | |
getPagesInRange ($lowerBound, $upperBound) | |
Returns a subset of pages within a given range. | |
getPageItemCache () | |
Returns the page item cache. | |
getView () | |
Retrieves the view instance. | |
setView (View\Renderer\RendererInterface $view=null) | |
Sets the view object. | |
normalizeItemNumber ($itemNumber) | |
Brings the item number in range of the page. | |
normalizePageNumber ($pageNumber) | |
Brings the page number in range of the paginator. | |
render (View\Renderer\RendererInterface $view=null) | |
Renders the paginator. | |
toJson () | |
Returns the items of the current page as JSON. | |
Static Public Member Functions | |
static | setGlobalConfig ($config) |
Set a global config. | |
static | getDefaultScrollingStyle () |
Returns the default scrolling style. | |
static | getDefaultItemCountPerPage () |
Get the default item count per page. | |
static | setDefaultItemCountPerPage ($count) |
Set the default item count per page. | |
static | setCache (CacheStorage $cache) |
Sets a cache object. | |
static | setDefaultScrollingStyle ($scrollingStyle= 'Sliding') |
Sets the default scrolling style. | |
static | setScrollingStylePluginManager ($scrollingAdapters) |
static | getScrollingStylePluginManager () |
Returns the scrolling style manager. | |
Public Attributes | |
const | CACHE_TAG_PREFIX = 'Zend_Paginator_' |
The cache tag prefix used to namespace Paginator results in the cache. | |
Protected Member Functions | |
cacheEnabled () | |
Tells if there is an active cache object and if the cache has not been disabled. | |
_getCacheId ($page=null) | |
Makes an Id for the cache Depends on the adapter object and the page number. | |
_getCacheInternalId () | |
Get the internal cache id Depends on the adapter and the item count per page. | |
_calculatePageCount () | |
Calculates the page count. | |
_createPages ($scrollingStyle=null) | |
Creates the page collection. | |
_loadScrollingStyle ($scrollingStyle=null) | |
Loads a scrolling style. | |
Protected Attributes | |
$cacheEnabled = true | |
$adapter = null | |
$currentItemCount = null | |
$currentItems = null | |
$currentPageNumber = 1 | |
$filter = null | |
$itemCountPerPage = null | |
$pageCount = null | |
$pageRange = 10 | |
$pages = null | |
$view = null | |
Static Protected Attributes | |
static | $adapters = null |
static | $config = null |
static | $defaultScrollingStyle = 'Sliding' |
static | $defaultItemCountPerPage = 10 |
static | $scrollingStyles = null |
static | $cache |
__construct | ( | $adapter | ) |
Constructor.
AdapterInterface | AdapterAggregateInterface | $adapter |
Exception\InvalidArgumentException |
__toString | ( | ) |
|
protected |
Calculates the page count.
|
protected |
Creates the page collection.
string | $scrollingStyle | Scrolling style |
|
protected |
Makes an Id for the cache Depends on the adapter object and the page number.
Used to store item in cache from that Paginator instance and that current page
int | $page |
|
protected |
Get the internal cache id Depends on the adapter and the item count per page.
Used to tag that unique Paginator instance in cache
|
protected |
Loads a scrolling style.
string | $scrollingStyle |
Exception\InvalidArgumentException |
|
protected |
Tells if there is an active cache object and if the cache has not been disabled.
clearPageItemCache | ( | $pageNumber = null | ) |
count | ( | ) |
Returns the number of pages.
getAbsoluteItemNumber | ( | $relativeItemNumber, | |
$pageNumber = null |
|||
) |
Returns the absolute item number for the specified item.
int | $relativeItemNumber | Relative item number |
int | $pageNumber | Page number |
getAdapter | ( | ) |
Returns the adapter.
getCurrentItemCount | ( | ) |
Returns the number of items for the current page.
getCurrentItems | ( | ) |
Returns the items for the current page.
getCurrentPageNumber | ( | ) |
Returns the current page number.
|
static |
Get the default item count per page.
|
static |
Returns the default scrolling style.
getFilter | ( | ) |
Get the filter.
getItem | ( | $itemNumber, | |
$pageNumber = null |
|||
) |
Returns an item from a page.
The current page is used if there's no page specified.
int | $itemNumber | Item number (1 to itemCountPerPage) |
int | $pageNumber |
Exception\InvalidArgumentException |
getItemCount | ( | $items | ) |
Returns the number of items in a collection.
mixed | $items | Items |
getItemCountPerPage | ( | ) |
Returns the number of items per page.
getItemsByPage | ( | $pageNumber | ) |
Returns the items for a given page.
int | $pageNumber |
getIterator | ( | ) |
Returns a foreach-compatible iterator.
Exception\RuntimeException |
getPageItemCache | ( | ) |
Returns the page item cache.
getPageRange | ( | ) |
Returns the page range (see property declaration above).
getPages | ( | $scrollingStyle = null | ) |
Returns the page collection.
string | $scrollingStyle | Scrolling style |
getPagesInRange | ( | $lowerBound, | |
$upperBound | |||
) |
Returns a subset of pages within a given range.
int | $lowerBound | Lower bound of the range |
int | $upperBound | Upper bound of the range |
|
static |
Returns the scrolling style manager.
If it doesn't exist it's created.
getTotalItemCount | ( | ) |
Returns the total number of items available.
getView | ( | ) |
Retrieves the view instance.
If none registered, instantiates a PhpRenderer instance.
normalizeItemNumber | ( | $itemNumber | ) |
Brings the item number in range of the page.
int | $itemNumber |
normalizePageNumber | ( | $pageNumber | ) |
Brings the page number in range of the paginator.
int | $pageNumber |
render | ( | View\Renderer\RendererInterface | $view = null | ) |
Renders the paginator.
\Zend\View\Renderer\RendererInterface | $view |
|
static |
Sets a cache object.
CacheStorage | $cache |
setCacheEnabled | ( | $enable | ) |
setCurrentPageNumber | ( | $pageNumber | ) |
|
static |
Set the default item count per page.
int | $count |
|
static |
Sets the default scrolling style.
string | $scrollingStyle |
setFilter | ( | FilterInterface | $filter | ) |
|
static |
Set a global config.
array | Traversable | $config |
Exception\InvalidArgumentException |
setItemCountPerPage | ( | $itemCountPerPage = -1 | ) |
setPageRange | ( | $pageRange | ) |
Sets the page range (see property declaration above).
int | $pageRange |
|
static |
setView | ( | View\Renderer\RendererInterface | $view = null | ) |
toJson | ( | ) |
Returns the items of the current page as JSON.
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
const CACHE_TAG_PREFIX = 'Zend_Paginator_' |
The cache tag prefix used to namespace Paginator results in the cache.