Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
string INTERNAL_ADAPTER = 'Zend_Paginator_Adapter_Internal'
Specifies that the factory should try to detect the proper adapter type first
CACHE_TAG_PREFIX = 'Zend_Paginator_'
The cache tag prefix used to namespace Paginator results in the cache
Zend_Paginator_Adapter_Interface $_adapter = 'null'
Adapter
Zend_Loader_PluginLoader $_adapterLoader = 'null'
Adapter plugin loader
Zend_Cache_Core $_cache = ''
Cache object
bool $_cacheEnabled = 'true'
Enable or disable the cache by Zend_Paginator instance
Zend_Config $_config = 'null'
Configuration file
integer $_currentItemCount = 'null'
Number of items in the current page
Traversable $_currentItems = 'null'
Current page items
integer $_currentPageNumber = '1'
Current page number (starting from 1)
int $_defaultItemCountPerPage = '10'
Default item count per page
string $_defaultScrollingStyle = 'Sliding'
Default scrolling style
Zend_Filter_Interface $_filter = 'null'
Result filter
integer $_itemCountPerPage = 'null'
Number of items per page
integer $_pageCount = 'null'
Number of pages
integer $_pageRange = '10'
Number of local pages (i.e., the number of discrete page numbers that will be displayed, including the current page number)
array $_pages = 'null'
Pages
Zend_Loader_PluginLoader $_scrollingStyleLoader = 'null'
Scrolling style plugin loader
Zend_View_Interface $_view = 'null'
View instance used for self rendering
__construct(
Zend_Paginator_Adapter_Interface|Zend_Paginator_AdapterAggregate $adapter
)
:
Constructor.
__toString(
)
:
string
Serializes the object as a string. Proxies to {@link render()}.
_cacheEnabled(
)
:
bool
Tells if there is an active cache object and if the cache has not been desabled
_calculatePageCount(
)
:
integer
Calculates the page count.
_createPages(
string $scrollingStyle
=
null
)
:
stdClass
Creates the page collection.
_getCacheId(
int $page
=
null
)
:
string
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
_getCacheInternalId(
)
:
string
Get the internal cache id Depends on the adapter and the item count per page
Used to tag that unique Paginator instance in cache
_loadScrollingStyle(
string $scrollingStyle
=
null
)
:
Zend_Paginator_ScrollingStyle_Interface
Loads a scrolling style.
addAdapterPrefixPath(
string $prefix, string $path
)
:
Adds an adapter prefix path to the plugin loader.
addAdapterPrefixPaths(
array $prefixPaths
)
:
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/'
);
addScrollingStylePrefixPath(
string $prefix, string $path
)
:
Adds a scrolling style prefix path to the plugin loader.
addScrollingStylePrefixPaths(
array $prefixPaths
)
:
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/'
);
clearPageItemCache(
int $pageNumber
=
null
)
:
Zend_Paginator
Clear the page item cache.
count(
)
:
integer
Returns the number of pages.
factory(
mixed $data, string $adapter
=
self, array $prefixPaths
=
null
)
:
Zend_Paginator
Factory.
getAbsoluteItemNumber(
integer $relativeItemNumber, integer $pageNumber
=
null
)
:
integer
Returns the absolute item number for the specified item.
getAdapter(
)
:
Zend_Paginator_Adapter_Interface
Returns the adapter.
getAdapterLoader(
)
:
Zend_Loader_PluginLoader
Returns the adapter loader. If it doesn't exist it's created.
getCurrentItemCount(
)
:
integer
Returns the number of items for the current page.
getCurrentItems(
)
:
Traversable
Returns the items for the current page.
getCurrentPageNumber(
)
:
integer
Returns the current page number.
getDefaultItemCountPerPage(
)
:
int
Get the default item count per page
getDefaultScrollingStyle(
)
:
string
Returns the default scrolling style.
getFilter(
)
:
Zend_Filter_Interface
Get the filter
getItem(
integer $itemNumber, integer $pageNumber
=
null
)
:
mixed
Returns an item from a page. The current page is used if there's no page sepcified.
getItemCount(
mixed $items
)
:
integer
Returns the number of items in a collection.
getItemCountPerPage(
)
:
integer
Returns the number of items per page.
getItemsByPage(
$pageNumber
)
:
Traversable
Returns the items for a given page.
getIterator(
)
:
Traversable
Returns a foreach-compatible iterator.
getPageItemCache(
)
:
array
Returns the page item cache.
getPageRange(
)
:
integer
Returns the page range (see property declaration above).
getPages(
string $scrollingStyle
=
null
)
:
array
Returns the page collection.
getPagesInRange(
integer $lowerBound, integer $upperBound
)
:
array
Returns a subset of pages within a given range.
getScrollingStyleLoader(
)
:
Zend_Loader_PluginLoader
Returns the scrolling style loader. If it doesn't exist it's created.
getTotalItemCount(
)
:
integer
Returns the total number of items available.
getView(
)
:
Zend_View_Interface|null
Retrieves the view instance. If none registered, attempts to pull f rom ViewRenderer.
normalizeItemNumber(
integer $itemNumber
)
:
integer
Brings the item number in range of the page.
normalizePageNumber(
integer $pageNumber
)
:
integer
Brings the page number in range of the paginator.
render(
Zend_View_Interface $view
=
null
)
:
string
Renders the paginator.
setCache(
Zend_Cache_Core $cache
)
:
Sets a cache object
setCacheEnabled(
bool $enable
)
:
Zend_Paginator
Enables/Disables the cache for this instance
setConfig(
Zend_Config $config
)
:
Set a global config
setCurrentPageNumber(
integer $pageNumber
)
:
Zend_Paginator
Sets the current page number.
setDefaultItemCountPerPage(
int $count
)
:
Set the default item count per page
setDefaultScrollingStyle(
string $scrollingStyle
=
Sliding
)
:
Sets the default scrolling style.
setFilter(
Zend_Filter_Interface $filter
)
:
Zend_Paginator
Set a filter chain
setItemCountPerPage(
integer $itemCountPerPage
)
:
Zend_Paginator
Sets the number of items per page.
setPageRange(
integer $pageRange
)
:
Zend_Paginator
Sets the page range (see property declaration above).
setView(
Zend_View_Interface $view
=
null
)
:
Zend_Paginator
Sets the view object.
toJson(
)
:
string
Returns the items of the current page as JSON.