Zend Framework
1.12
|
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 (Zend_Filter_Interface $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 (Zend_View_Interface $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 (Zend_View_Interface $view=null) | |
Renders the paginator. | |
toJson () | |
Returns the items of the current page as JSON. | |
Static Public Member Functions | |
static | addAdapterPrefixPath ($prefix, $path) |
Adds an adapter prefix path to the plugin loader. | |
static | addAdapterPrefixPaths (array $prefixPaths) |
Adds an array of adapter prefix paths to the plugin loader. | |
static | addScrollingStylePrefixPath ($prefix, $path) |
Adds a scrolling style prefix path to the plugin loader. | |
static | addScrollingStylePrefixPaths (array $prefixPaths) |
Adds an array of scrolling style prefix paths to the plugin loader. | |
static | factory ($data, $adapter=self::INTERNAL_ADAPTER, array $prefixPaths=null) |
Factory. | |
static | getAdapterLoader () |
Returns the adapter loader. | |
static | setConfig (Zend_Config $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 | getDefaultPageRange () |
Get the default page range. | |
static | setDefaultPageRange ($count) |
Set the default page range. | |
static | setCache (Zend_Cache_Core $cache) |
Sets a cache object. | |
static | setDefaultScrollingStyle ($scrollingStyle= 'Sliding') |
Sets the default scrolling style. | |
static | getScrollingStyleLoader () |
Returns the scrolling style loader. | |
Public Attributes | |
const | INTERNAL_ADAPTER = 'Zend_Paginator_Adapter_Internal' |
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 desabled. | |
_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 = null | |
$_pages = null | |
$_view = null | |
Static Protected Attributes | |
static | $_adapterLoader = null |
static | $_config = null |
static | $_defaultScrollingStyle = 'Sliding' |
static | $_defaultItemCountPerPage = 10 |
static | $_defaultPageRange = 10 |
static | $_scrollingStyleLoader = null |
static | $_cache |
__construct | ( | $adapter | ) |
Constructor.
Zend_Paginator_Adapter_Interface | Zend_Paginator_AdapterAggregate | $adapter |
__toString | ( | ) |
|
protected |
Tells if there is an active cache object and if the cache has not been desabled.
|
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 |
|
static |
Adds an adapter prefix path to the plugin loader.
string | $prefix | |
string | $path |
|
static |
Adds an array of adapter prefix paths to the plugin loader.
$prefixPaths = array( 'My_Paginator_Adapter' => 'My/Paginator/Adapter/', 'Your_Paginator_Adapter' => 'Your/Paginator/Adapter/' );
array | $prefixPaths |
|
static |
Adds a scrolling style prefix path to the plugin loader.
string | $prefix | |
string | $path |
|
static |
Adds an array of scrolling style prefix paths to the plugin loader.
$prefixPaths = array( 'My_Paginator_ScrollingStyle' => 'My/Paginator/ScrollingStyle/', 'Your_Paginator_ScrollingStyle' => 'Your/Paginator/ScrollingStyle/' );
array | $prefixPaths |
clearPageItemCache | ( | $pageNumber = null | ) |
count | ( | ) |
Returns the number of pages.
|
static |
Factory.
mixed | $data | |
string | $adapter | |
array | $prefixPaths |
getAbsoluteItemNumber | ( | $relativeItemNumber, | |
$pageNumber = null |
|||
) |
Returns the absolute item number for the specified item.
integer | $relativeItemNumber | Relative item number |
integer | $pageNumber | Page number |
getAdapter | ( | ) |
Returns the adapter.
|
static |
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 |
Get the default page range.
|
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 sepcified.
integer | $itemNumber | Item number (1 to itemCountPerPage) |
integer | $pageNumber |
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.
getIterator | ( | ) |
Returns a foreach-compatible iterator.
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.
integer | $lowerBound | Lower bound of the range |
integer | $upperBound | Upper bound of the range |
|
static |
Returns the scrolling style loader.
If it doesn't exist it's created.
getTotalItemCount | ( | ) |
Returns the total number of items available.
Uses cache if caching is enabled.
getView | ( | ) |
Retrieves the view instance.
If none registered, attempts to pull f rom ViewRenderer.
normalizeItemNumber | ( | $itemNumber | ) |
Brings the item number in range of the page.
integer | $itemNumber |
normalizePageNumber | ( | $pageNumber | ) |
Brings the page number in range of the paginator.
integer | $pageNumber |
render | ( | Zend_View_Interface | $view = null | ) |
|
static |
Sets a cache object.
Zend_Cache_Core | $cache |
setCacheEnabled | ( | $enable | ) |
|
static |
Set a global config.
Zend_Config | $config |
setCurrentPageNumber | ( | $pageNumber | ) |
|
static |
Set the default item count per page.
int | $count |
|
static |
Set the default page range.
int | $count |
|
static |
Sets the default scrolling style.
string | $scrollingStyle |
setFilter | ( | Zend_Filter_Interface | $filter | ) |
setItemCountPerPage | ( | $itemCountPerPage = -1 | ) |
setPageRange | ( | $pageRange | ) |
Sets the page range (see property declaration above).
integer | $pageRange |
setView | ( | Zend_View_Interface | $view = null | ) |
toJson | ( | ) |
Returns the items of the current page as JSON.
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
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.
const INTERNAL_ADAPTER = 'Zend_Paginator_Adapter_Internal' |