Paginator.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Paginator
- Version
- $Id$
\Zend_Paginator
- Implements
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
string
INTERNAL_ADAPTER
= 'Zend_Paginator_Adapter_Internal'- INTERNAL_ADAPTER
- string
Properties

bool $_cacheEnabled = truetrueDetails- Type
- bool

integer $_currentItemCount = nullnullDetails- Type
- integer

integer $_currentPageNumber = 11Details- Type
- integer

int $_defaultPageRange = 1010Details- Type
- int

string $_defaultScrollingStyle = 'Sliding''Sliding'Details- Type
- string

integer $_pageRange = nullnullDetails- Type
- integer

\Zend_Loader_PluginLoader $_scrollingStyleLoader = nullnullDetailsMethods

__construct(\Zend_Paginator_Adapter_Interface | \Zend_Paginator_AdapterAggregate $adapter) : voidConstructor.
| Name | Type | Description |
|---|---|---|
| $adapter | \Zend_Paginator_Adapter_Interface | \Zend_Paginator_AdapterAggregate |

__toString() : stringSerializes the object as a string. Proxies to {@link render()}.
| Type | Description |
|---|---|
| string |

_cacheEnabled() : boolTells if there is an active cache object and if the cache has not been desabled
| Type | Description |
|---|---|
| bool |

_createPages(string $scrollingStyle = null) : \stdClassCreates the page collection.
| Name | Type | Description |
|---|---|---|
| $scrollingStyle | string | Scrolling style |
| Type | Description |
|---|---|
| \stdClass |

_getCacheId(int $page = null) : stringMakes an Id for the cache Depends on the adapter object and the page number
| Name | Type | Description |
|---|---|---|
| $page | int |
| Type | Description |
|---|---|
| string |

_getCacheInternalId() : stringGet the internal cache id Depends on the adapter and the item count per page
| Type | Description |
|---|---|
| string |

_loadScrollingStyle(string $scrollingStyle = null) : \Zend_Paginator_ScrollingStyle_InterfaceLoads a scrolling style.
| Name | Type | Description |
|---|---|---|
| $scrollingStyle | string |
| Type | Description |
|---|---|
| \Zend_Paginator_ScrollingStyle_Interface |

addAdapterPrefixPath(string $prefix, string $path) : voidAdds an adapter prefix path to the plugin loader.
| Name | Type | Description |
|---|---|---|
| $prefix | string | |
| $path | string |

addAdapterPrefixPaths(array $prefixPaths) : voidAdds an array of adapter prefix paths to the plugin loader.
$prefixPaths = array(
'My_Paginator_Adapter' => 'My/Paginator/Adapter/',
'Your_Paginator_Adapter' => 'Your/Paginator/Adapter/'
);
| Name | Type | Description |
|---|---|---|
| $prefixPaths | array |

addScrollingStylePrefixPath(string $prefix, string $path) : voidAdds a scrolling style prefix path to the plugin loader.
| Name | Type | Description |
|---|---|---|
| $prefix | string | |
| $path | string |

addScrollingStylePrefixPaths(array $prefixPaths) : voidAdds 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/'
);
| Name | Type | Description |
|---|---|---|
| $prefixPaths | array |

clearPageItemCache(int $pageNumber = null) : \Zend_PaginatorClear the page item cache.
| Name | Type | Description |
|---|---|---|
| $pageNumber | int |
| Type | Description |
|---|---|
| \Zend_Paginator |

factory(mixed $data, string $adapter = self::INTERNAL_ADAPTER, array $prefixPaths = null) : \Zend_PaginatorFactory.
| Name | Type | Description |
|---|---|---|
| $data | mixed | |
| $adapter | string | |
| $prefixPaths | array |
| Type | Description |
|---|---|
| \Zend_Paginator |

getAbsoluteItemNumber(integer $relativeItemNumber, integer $pageNumber = null) : integerReturns the absolute item number for the specified item.
| Name | Type | Description |
|---|---|---|
| $relativeItemNumber | integer | Relative item number |
| $pageNumber | integer | Page number |
| Type | Description |
|---|---|
| integer |

getAdapter() : \Zend_Paginator_Adapter_InterfaceReturns the adapter.
| Type | Description |
|---|---|
| \Zend_Paginator_Adapter_Interface |

getAdapterLoader() : \Zend_Loader_PluginLoaderReturns the adapter loader. If it doesn't exist it's created.
| Type | Description |
|---|---|
| \Zend_Loader_PluginLoader |

getCurrentItemCount() : integerReturns the number of items for the current page.
| Type | Description |
|---|---|
| integer |

getCurrentItems() : \TraversableReturns the items for the current page.
| Type | Description |
|---|---|
| \Traversable |

getDefaultItemCountPerPage() : intGet the default item count per page
| Type | Description |
|---|---|
| int |

getDefaultScrollingStyle() : stringReturns the default scrolling style.
| Type | Description |
|---|---|
| string |

getItem(integer $itemNumber, integer $pageNumber = null) : mixedReturns an item from a page. The current page is used if there's no page sepcified.
| Name | Type | Description |
|---|---|---|
| $itemNumber | integer | Item number (1 to itemCountPerPage) |
| $pageNumber | integer |
| Type | Description |
|---|---|
| mixed |

getItemCount(mixed $items) : integerReturns the number of items in a collection.
| Name | Type | Description |
|---|---|---|
| $items | mixed | Items |
| Type | Description |
|---|---|
| integer |

getItemsByPage( $pageNumber) : \TraversableReturns the items for a given page.
| Name | Type | Description |
|---|---|---|
| $pageNumber |
| Type | Description |
|---|---|
| \Traversable |

getIterator() : \TraversableReturns a foreach-compatible iterator.
| Type | Description |
|---|---|
| \Traversable |

getPageRange() : integerReturns the page range (see property declaration above).
| Type | Description |
|---|---|
| integer |

getPages(string $scrollingStyle = null) : arrayReturns the page collection.
| Name | Type | Description |
|---|---|---|
| $scrollingStyle | string | Scrolling style |
| Type | Description |
|---|---|
| array |

getPagesInRange(integer $lowerBound, integer $upperBound) : arrayReturns a subset of pages within a given range.
| Name | Type | Description |
|---|---|---|
| $lowerBound | integer | Lower bound of the range |
| $upperBound | integer | Upper bound of the range |
| Type | Description |
|---|---|
| array |

getScrollingStyleLoader() : \Zend_Loader_PluginLoaderReturns the scrolling style loader. If it doesn't exist it's created.
| Type | Description |
|---|---|
| \Zend_Loader_PluginLoader |

getTotalItemCount() : integerReturns the total number of items available. Uses cache if caching is enabled.
| Type | Description |
|---|---|
| integer |

getView() : \Zend_View_Interface | nullRetrieves the view instance. If none registered, attempts to pull f rom ViewRenderer.
| Type | Description |
|---|---|
| \Zend_View_Interface | null |

normalizeItemNumber(integer $itemNumber) : integerBrings the item number in range of the page.
| Name | Type | Description |
|---|---|---|
| $itemNumber | integer |
| Type | Description |
|---|---|
| integer |

normalizePageNumber(integer $pageNumber) : integerBrings the page number in range of the paginator.
| Name | Type | Description |
|---|---|---|
| $pageNumber | integer |
| Type | Description |
|---|---|
| integer |

render(\Zend_View_Interface $view = null) : stringRenders the paginator.
| Name | Type | Description |
|---|---|---|
| $view | \Zend_View_Interface |
| Type | Description |
|---|---|
| string |

setCache(\Zend_Cache_Core $cache) : voidSets a cache object
| Name | Type | Description |
|---|---|---|
| $cache | \Zend_Cache_Core |

setCacheEnabled(bool $enable) : \Zend_PaginatorEnables/Disables the cache for this instance
| Name | Type | Description |
|---|---|---|
| $enable | bool |
| Type | Description |
|---|---|
| \Zend_Paginator |

setConfig(\Zend_Config $config) : voidSet a global config
| Name | Type | Description |
|---|---|---|
| $config | \Zend_Config |

setCurrentPageNumber(integer $pageNumber) : \Zend_PaginatorSets the current page number.
| Name | Type | Description |
|---|---|---|
| $pageNumber | integer | Page number |
| Type | Description |
|---|---|
| \Zend_Paginator | $this |

setDefaultItemCountPerPage(int $count) : voidSet the default item count per page
| Name | Type | Description |
|---|---|---|
| $count | int |

setDefaultPageRange(int $count) : voidSet the default page range
| Name | Type | Description |
|---|---|---|
| $count | int |

setDefaultScrollingStyle(string $scrollingStyle = 'Sliding') : voidSets the default scrolling style.
| Name | Type | Description |
|---|---|---|
| $scrollingStyle | string |

setFilter(\Zend_Filter_Interface $filter) : \Zend_PaginatorSet a filter chain
| Name | Type | Description |
|---|---|---|
| $filter | \Zend_Filter_Interface |
| Type | Description |
|---|---|
| \Zend_Paginator |

setItemCountPerPage(integer $itemCountPerPage = -1) : \Zend_PaginatorSets the number of items per page.
| Name | Type | Description |
|---|---|---|
| $itemCountPerPage | integer |
| Type | Description |
|---|---|
| \Zend_Paginator | $this |

setPageRange(integer $pageRange) : \Zend_PaginatorSets the page range (see property declaration above).
| Name | Type | Description |
|---|---|---|
| $pageRange | integer |
| Type | Description |
|---|---|
| \Zend_Paginator | $this |

setView(\Zend_View_Interface $view = null) : \Zend_PaginatorSets the view object.
| Name | Type | Description |
|---|---|---|
| $view | \Zend_View_Interface |
| Type | Description |
|---|---|
| \Zend_Paginator |