1359. Class

1359.1. Zend\Paginator\Paginator

1359.1.1. Methods

1359.1.1.1. setGlobalConfig

setGlobalConfig()

Set a global config

Parameters:array|Traversable
Throws ExceptionInvalidArgumentException:
 

1359.1.1.2. getDefaultScrollingStyle

getDefaultScrollingStyle()

Returns the default scrolling style.

Return type:string

1359.1.1.3. getDefaultItemCountPerPage

getDefaultItemCountPerPage()

Get the default item count per page

Return type:int

1359.1.1.4. setDefaultItemCountPerPage

setDefaultItemCountPerPage()

Set the default item count per page

Parameters:int

1359.1.1.5. setCache

setCache()

Sets a cache object

Parameters:CacheStorage

1359.1.1.6. setDefaultScrollingStyle

setDefaultScrollingStyle()

Sets the default scrolling style.

Parameters:string

1359.1.1.7. setScrollingStylePluginManager

setScrollingStylePluginManager()

1359.1.1.8. getScrollingStylePluginManager

getScrollingStylePluginManager()

Returns the scrolling style manager. If it doesn’t exist it’s created.

Return type:ScrollingStylePluginManager

1359.1.1.9. __construct

__construct()

Constructor.

Parameters:AdapterInterface|AdapterAggregateInterface
Throws ExceptionInvalidArgumentException:
 

1359.1.1.10. __toString

__toString()

Serializes the object as a string. Proxies to {@link render()}.

Return type:string

1359.1.1.11. setCacheEnabled

setCacheEnabled()

Enables/Disables the cache for this instance

Parameters:bool
Return type:Paginator

1359.1.1.12. count

count()

Returns the number of pages.

Return type:integer

1359.1.1.13. getTotalItemCount

getTotalItemCount()

Returns the total number of items available.

Return type:integer

1359.1.1.14. clearPageItemCache

clearPageItemCache()

Clear the page item cache.

Parameters:int
Return type:Paginator

1359.1.1.15. getAbsoluteItemNumber

getAbsoluteItemNumber()

Returns the absolute item number for the specified item.

Parameters:
  • integer – Relative item number
  • integer – Page number
Return type:

integer

1359.1.1.16. getAdapter

getAdapter()

Returns the adapter.

Return type:AdapterInterface

1359.1.1.17. getCurrentItemCount

getCurrentItemCount()

Returns the number of items for the current page.

Return type:integer

1359.1.1.18. getCurrentItems

getCurrentItems()

Returns the items for the current page.

Return type:Traversable

1359.1.1.19. getCurrentPageNumber

getCurrentPageNumber()

Returns the current page number.

Return type:integer

1359.1.1.20. setCurrentPageNumber

setCurrentPageNumber()

Sets the current page number.

Parameters:integer – Page number
Return type:Paginator $this

1359.1.1.21. getFilter

getFilter()

Get the filter

Return type:FilterInterface

1359.1.1.22. setFilter

setFilter()

Set a filter chain

Parameters:FilterInterface
Return type:Paginator

1359.1.1.23. getItem

getItem()

Returns an item from a page. The current page is used if there’s no page specified.

Parameters:
  • integer – Item number (1 to itemCountPerPage)
  • integer
Throws ExceptionInvalidArgumentException:
 
Return type:

mixed

1359.1.1.24. getItemCountPerPage

getItemCountPerPage()

Returns the number of items per page.

Return type:integer

1359.1.1.25. setItemCountPerPage

setItemCountPerPage()

Sets the number of items per page.

Parameters:integer
Return type:Paginator $this

1359.1.1.26. getItemCount

getItemCount()

Returns the number of items in a collection.

Parameters:mixed – Items
Return type:integer

1359.1.1.27. getItemsByPage

getItemsByPage()

Returns the items for a given page.

Parameters:integer
Return type:mixed

1359.1.1.28. getIterator

getIterator()

Returns a foreach-compatible iterator.

Return type:Traversable

1359.1.1.29. getPageRange

getPageRange()

Returns the page range (see property declaration above).

Return type:integer

1359.1.1.30. setPageRange

setPageRange()

Sets the page range (see property declaration above).

Parameters:integer
Return type:Paginator $this

1359.1.1.31. getPages

getPages()

Returns the page collection.

Parameters:string – Scrolling style
Return type:array

1359.1.1.32. getPagesInRange

getPagesInRange()

Returns a subset of pages within a given range.

Parameters:
  • integer – Lower bound of the range
  • integer – Upper bound of the range
Return type:

array

1359.1.1.33. getPageItemCache

getPageItemCache()

Returns the page item cache.

Return type:array

1359.1.1.34. getView

getView()

Retrieves the view instance.

If none registered, instantiates a PhpRenderer instance.

Return type:ZendViewRendererRendererInterface|null

1359.1.1.35. setView

setView()

Sets the view object.

Parameters:ZendViewRendererRendererInterface
Return type:Paginator

1359.1.1.36. normalizeItemNumber

normalizeItemNumber()

Brings the item number in range of the page.

Parameters:integer
Return type:integer

1359.1.1.37. normalizePageNumber

normalizePageNumber()

Brings the page number in range of the paginator.

Parameters:integer
Return type:integer

1359.1.1.38. render

render()

Renders the paginator.

Parameters:ZendViewRendererRendererInterface
Return type:string

1359.1.1.39. toJson

toJson()

Returns the items of the current page as JSON.

Return type:string

1359.1.1.40. cacheEnabled

cacheEnabled()

Tells if there is an active cache object and if the cache has not been disabled

Return type:bool

1359.1.1.41. _getCacheId

_getCacheId()

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
Parameters:int
Return type:string

1359.1.1.42. _getCacheInternalId

_getCacheInternalId()

Get the internal cache id Depends on the adapter and the item count per page

Used to tag that unique Paginator instance in cache

Return type:string

1359.1.1.43. _calculatePageCount

_calculatePageCount()

Calculates the page count.

Return type:integer

1359.1.1.44. _createPages

_createPages()

Creates the page collection.

Parameters:string – Scrolling style
Return type:stdClass

1359.1.1.45. _loadScrollingStyle

_loadScrollingStyle()

Loads a scrolling style.

Parameters:string
Return type:ScrollingStyleInterface
Throws :ExceptionInvalidArgumentException

1359.1.2. Constants

1359.1.2.1. CACHE_TAG_PREFIX

The cache tag prefix used to namespace Paginator results in the cache

Project Versions

Table Of Contents

Previous topic

1358. Class

Next topic

1360. Class

This Page