Public Member Functions | |
__construct ($adapter) | |
__toString () | |
setCacheEnabled ($enable) | |
count () | |
getTotalItemCount () | |
clearPageItemCache ($pageNumber=null) | |
getAbsoluteItemNumber ($relativeItemNumber, $pageNumber=null) | |
getAdapter () | |
getCurrentItemCount () | |
getCurrentItems () | |
getCurrentPageNumber () | |
setCurrentPageNumber ($pageNumber) | |
getFilter () | |
setFilter (Zend_Filter_Interface $filter) | |
getItem ($itemNumber, $pageNumber=null) | |
getItemCountPerPage () | |
setItemCountPerPage ($itemCountPerPage) | |
getItemCount ($items) | |
getItemsByPage ($pageNumber) | |
getIterator () | |
getPageRange () | |
setPageRange ($pageRange) | |
getPages ($scrollingStyle=null) | |
getPagesInRange ($lowerBound, $upperBound) | |
getPageItemCache () | |
getView () | |
setView (Zend_View_Interface $view=null) | |
normalizeItemNumber ($itemNumber) | |
normalizePageNumber ($pageNumber) | |
render (Zend_View_Interface $view=null) | |
toJson () | |
Static Public Member Functions | |
static | addAdapterPrefixPath ($prefix, $path) |
static | addAdapterPrefixPaths (array $prefixPaths) |
static | addScrollingStylePrefixPath ($prefix, $path) |
static | addScrollingStylePrefixPaths (array $prefixPaths) |
static | factory ($data, $adapter=self::INTERNAL_ADAPTER, array $prefixPaths=null) |
static | getAdapterLoader () |
static | setConfig (Zend_Config $config) |
static | getDefaultScrollingStyle () |
static | getDefaultItemCountPerPage () |
static | setDefaultItemCountPerPage ($count) |
static | setCache (Zend_Cache_Core $cache) |
static | setDefaultScrollingStyle ($scrollingStyle= 'Sliding') |
static | getScrollingStyleLoader () |
Data Fields | |
const | INTERNAL_ADAPTER = 'Zend_Paginator_Adapter_Internal' |
const | CACHE_TAG_PREFIX = 'Zend_Paginator_' |
Protected Member Functions | |
_cacheEnabled () | |
_getCacheId ($page=null) | |
_getCacheInternalId () | |
_calculatePageCount () | |
_createPages ($scrollingStyle=null) | |
_loadScrollingStyle ($scrollingStyle=null) | |
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 | $_adapterLoader = null |
static | $_config = null |
static | $_defaultScrollingStyle = 'Sliding' |
static | $_defaultItemCountPerPage = 10 |
static | $_scrollingStyleLoader = null |
static | $_cache |
Definition at line 38 of file Paginator.php.
__construct | ( | $ | adapter ) |
Constructor.
Zend_Paginator_Adapter_Interface | Zend_Paginator_AdapterAggregate | $adapter |
Definition at line 420 of file Paginator.php.
__toString | ( | ) |
Serializes the object as a string. Proxies to render().
Definition at line 459 of file Paginator.php.
_cacheEnabled | ( | ) | [protected] |
Tells if there is an active cache object and if the cache has not been desabled
Definition at line 972 of file Paginator.php.
_calculatePageCount | ( | ) | [protected] |
_createPages | ( | $ | scrollingStyle = null ) |
[protected] |
Creates the page collection.
string | $scrollingStyle | Scrolling style |
Definition at line 1024 of file Paginator.php.
_getCacheId | ( | $ | page = null ) |
[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 |
Definition at line 987 of file Paginator.php.
_getCacheInternalId | ( | ) | [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
Definition at line 1003 of file Paginator.php.
_loadScrollingStyle | ( | $ | scrollingStyle = null ) |
[protected] |
Loads a scrolling style.
string | $scrollingStyle |
Definition at line 1069 of file Paginator.php.
static addAdapterPrefixPath | ( | $ | prefix, |
$ | path | ||
) | [static] |
Adds an adapter prefix path to the plugin loader.
string | $prefix | |
string | $path |
Definition at line 179 of file Paginator.php.
static addAdapterPrefixPaths | ( | array $ | prefixPaths ) | [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 |
Definition at line 197 of file Paginator.php.
static addScrollingStylePrefixPath | ( | $ | prefix, |
$ | path | ||
) | [static] |
Adds a scrolling style prefix path to the plugin loader.
string | $prefix | |
string | $path |
Definition at line 219 of file Paginator.php.
static addScrollingStylePrefixPaths | ( | array $ | prefixPaths ) | [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 |
Definition at line 237 of file Paginator.php.
clearPageItemCache | ( | $ | pageNumber = null ) |
Clear the page item cache.
int | $pageNumber |
Definition at line 513 of file Paginator.php.
count | ( | ) |
static factory | ( | $ | data, |
$ | adapter = self::INTERNAL_ADAPTER , |
||
array $ | prefixPaths = null |
||
) | [static] |
Factory.
mixed | $data | |
string | $adapter | |
array | $prefixPaths |
Definition at line 261 of file Paginator.php.
getAbsoluteItemNumber | ( | $ | relativeItemNumber, |
$ | pageNumber = null |
||
) |
Returns the absolute item number for the specified item.
integer | $relativeItemNumber | Relative item number |
integer | $pageNumber | Page number |
Definition at line 540 of file Paginator.php.
getAdapter | ( | ) |
Returns the adapter.
Definition at line 558 of file Paginator.php.
static getAdapterLoader | ( | ) | [static] |
Returns the adapter loader. If it doesn't exist it's created.
Definition at line 309 of file Paginator.php.
getCurrentItemCount | ( | ) |
Returns the number of items for the current page.
Definition at line 568 of file Paginator.php.
getCurrentItems | ( | ) |
Returns the items for the current page.
Definition at line 582 of file Paginator.php.
getCurrentPageNumber | ( | ) |
static getDefaultItemCountPerPage | ( | ) | [static] |
static getDefaultScrollingStyle | ( | ) | [static] |
getFilter | ( | ) |
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 |
Definition at line 647 of file Paginator.php.
getItemCount | ( | $ | items ) |
Returns the number of items in a collection.
mixed | $items | Items |
Definition at line 719 of file Paginator.php.
getItemCountPerPage | ( | ) |
getItemsByPage | ( | $ | pageNumber ) |
Returns the items for a given page.
Definition at line 737 of file Paginator.php.
getIterator | ( | ) |
Returns a foreach-compatible iterator.
Definition at line 774 of file Paginator.php.
getPageItemCache | ( | ) |
getPageRange | ( | ) |
Returns the page range (see property declaration above).
Definition at line 784 of file Paginator.php.
getPages | ( | $ | scrollingStyle = null ) |
Returns the page collection.
string | $scrollingStyle | Scrolling style |
Definition at line 808 of file Paginator.php.
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 |
Definition at line 824 of file Paginator.php.
static getScrollingStyleLoader | ( | ) | [static] |
Returns the scrolling style loader. If it doesn't exist it's created.
Definition at line 404 of file Paginator.php.
getTotalItemCount | ( | ) |
Returns the total number of items available.
Definition at line 502 of file Paginator.php.
getView | ( | ) |
Retrieves the view instance. If none registered, attempts to pull f rom ViewRenderer.
Definition at line 862 of file Paginator.php.
normalizeItemNumber | ( | $ | itemNumber ) |
Brings the item number in range of the page.
integer | $itemNumber |
Definition at line 899 of file Paginator.php.
normalizePageNumber | ( | $ | pageNumber ) |
Brings the page number in range of the paginator.
integer | $pageNumber |
Definition at line 918 of file Paginator.php.
render | ( | Zend_View_Interface $ | view = null ) |
Renders the paginator.
Zend_View_Interface | $view |
Definition at line 939 of file Paginator.php.
static setCache | ( | Zend_Cache_Core $ | cache ) | [static] |
setCacheEnabled | ( | $ | enable ) |
Enables/Disables the cache for this instance
bool | $enable |
Definition at line 477 of file Paginator.php.
static setConfig | ( | Zend_Config $ | config ) | [static] |
setCurrentPageNumber | ( | $ | pageNumber ) |
Sets the current page number.
integer | $pageNumber | Page number |
Definition at line 607 of file Paginator.php.
static setDefaultItemCountPerPage | ( | $ | count ) | [static] |
Set the default item count per page
int | $count |
Definition at line 373 of file Paginator.php.
static setDefaultScrollingStyle | ( | $ | scrollingStyle = 'Sliding' ) |
[static] |
Sets the default scrolling style.
string | $scrollingStyle |
Definition at line 393 of file Paginator.php.
setFilter | ( | Zend_Filter_Interface $ | filter ) |
Set a filter chain
Zend_Filter_Interface | $filter |
Definition at line 632 of file Paginator.php.
setItemCountPerPage | ( | $ | itemCountPerPage ) |
Sets the number of items per page.
integer | $itemCountPerPage |
Definition at line 700 of file Paginator.php.
setPageRange | ( | $ | pageRange ) |
Sets the page range (see property declaration above).
integer | $pageRange |
Definition at line 795 of file Paginator.php.
setView | ( | Zend_View_Interface $ | view = null ) |
Sets the view object.
Zend_View_Interface | $view |
Definition at line 886 of file Paginator.php.
toJson | ( | ) |
Returns the items of the current page as JSON.
Definition at line 955 of file Paginator.php.
const CACHE_TAG_PREFIX = 'Zend_Paginator_' |
The cache tag prefix used to namespace Paginator results in the cache
Definition at line 51 of file Paginator.php.