Zend\Paginator\Paginator
Synopsis
class Paginator
implements
Countable,IteratorAggregate
{
- // constants
- const CACHE_TAG_PREFIX = 'Zend_Paginator_';
- // members
- protected AdapterPluginManager $adapters;
- protected array|null $config;
- protected string $defaultScrollingStyle;
- protected integer $defaultItemCountPerPage;
- protected ScrollingStylePluginManager $scrollingStyles;
- protected StorageInterface $cache;
- protected bool $cacheEnabled;
- protected AdapterInterface $adapter;
- protected int $currentItemCount;
- protected Traversable $currentItems;
- protected integer $currentPageNumber;
- protected FilterInterface $filter;
- protected int $itemCountPerPage;
- protected int $pageCount;
- protected integer $pageRange;
- protected array $pages;
- protected RendererInterface $view;
- // methods
- public static void setGlobalConfig()
- public static string getDefaultScrollingStyle()
- public static int getDefaultItemCountPerPage()
- public static void setDefaultItemCountPerPage()
- public static void setCache()
- public static void setDefaultScrollingStyle()
- public static void setScrollingStylePluginManager()
- public static ScrollingStylePluginManager getScrollingStylePluginManager()
- public void __construct()
- public string __toString()
- public Paginator setCacheEnabled()
- public int count()
- public int getTotalItemCount()
- public Paginator clearPageItemCache()
- public int getAbsoluteItemNumber()
- public AdapterInterface getAdapter()
- public int getCurrentItemCount()
- public Traversable getCurrentItems()
- public int getCurrentPageNumber()
- public Paginator setCurrentPageNumber()
- public FilterInterface getFilter()
- public Paginator setFilter()
- public mixed getItem()
- public int getItemCountPerPage()
- public Paginator setItemCountPerPage()
- public int getItemCount()
- public mixed getItemsByPage()
- public Traversable getIterator()
- public int getPageRange()
- public Paginator setPageRange()
- public array getPages()
- public array getPagesInRange()
- public array getPageItemCache()
- public RendererInterface|null getView()
- public Paginator setView()
- public int normalizeItemNumber()
- public int normalizePageNumber()
- public string render()
- public string toJson()
- protected bool cacheEnabled()
- protected string _getCacheId()
- protected string _getCacheInternalId()
- protected int _calculatePageCount()
- protected stdClass _createPages()
- protected ScrollingStyleInterface _loadScrollingStyle()
Hierarchy
Implements
Constants
Name | Value |
---|---|
CACHE_TAG_PREFIX | 'Zend_Paginator_' |
Members
protected
- $adapter
—
Zend\Paginator\Adapter\AdapterInterface
Adapter - $adapters
—
Zend\Paginator\AdapterPluginManager
Adapter plugin manager - $cache
—
Zend\Cache\Storage\StorageInterface
Cache object - $cacheEnabled
—
Zend\Paginator\bool
Enable or disable the cache by Zend\Paginator\Paginator instance - $config
—
Zend\Paginator\array|null
Configuration file - $currentItemCount
—
int
Number of items in the current page - $currentItems
—
Traversable
Current page items - $currentPageNumber
—
int
Current page number (starting from 1) - $defaultItemCountPerPage
—
int
Default item count per page - $defaultScrollingStyle
—
string
Default scrolling style - $filter
—
Zend\Filter\FilterInterface
Result filter - $itemCountPerPage
—
int
Number of items per page - $pageCount
—
int
Number of pages - $pageRange
—
int
Number of local pages (i.e., the number of discrete page numbers that will be displayed, including the current page number) - $pages
—
array
Pages - $scrollingStyles
—
Zend\Paginator\ScrollingStylePluginManager
Scrolling style plugin manager - $view
—
\Zend\View\Renderer\RendererInterface
View instance used for self rendering
Methods
protected
- _calculatePageCount() — Calculates the page count.
- _createPages() — Creates the page collection.
- _getCacheId() — 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
- _loadScrollingStyle() — Loads a scrolling style.
- cacheEnabled() — Tells if there is an active cache object and if the cache has not been disabled
public
- __construct() — Constructor.
- __toString() — Serializes the object as a string. Proxies to {@link render()}.
- clearPageItemCache() — Clear the page item cache.
- count() — Returns the number of pages.
- getAbsoluteItemNumber() — 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.
- getDefaultItemCountPerPage() — Get the default item count per page
- getDefaultScrollingStyle() — Returns the default scrolling style.
- getFilter() — Get the filter
- getItem() — Returns an item from a page. The current page is used if there's no page specified.
- getItemCount() — Returns the number of items in a collection.
- getItemCountPerPage() — Returns the number of items per page.
- getItemsByPage() — 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() — Returns the page collection.
- getPagesInRange() — Returns a subset of pages within a given range.
- getScrollingStylePluginManager() — 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.
- normalizeItemNumber() — Brings the item number in range of the page.
- normalizePageNumber() — Brings the page number in range of the paginator.
- render() — Renders the paginator.
- setCache() — Sets a cache object
- setCacheEnabled() — Enables/Disables the cache for this instance
- setCurrentPageNumber() — Sets the current page number.
- setDefaultItemCountPerPage() — Set the default item count per page
- setDefaultScrollingStyle() — Sets the default scrolling style.
- setFilter() — Set a filter chain
- setGlobalConfig() — Set a global config
- setItemCountPerPage() — Sets the number of items per page.
- setPageRange() — Sets the page range (see property declaration above).
- setScrollingStylePluginManager()
- setView() — Sets the view object.
- toJson() — Returns the items of the current page as JSON.