Pagination

Extends Object. The Pagination object is generally used in conjunction with SearchPageSearch, CategorySearch or ProductSearch objects.

Properties
name

Type String or Null

Currently not implemented.

page

Type Number

The current page number starting from 1

perPage

Type Number or Null

The number of rows to retrieve per page

search

Type Search

The search algorithm used to get a list of pages, categories or products. The type of search may be Search, PageSearch, CategorySearch or ProductSearch



Methods
isFirstPage()

Returns Boolean

True if the current page is the first in the series.

isLastPage()

Returns Boolean

True if the current page is the last in the series.

nextPage()

Returns Number or Null

The next page number or null if no further pages are available in the series.

page(Number:number)

Sets the page number for the seearch algorithm and then returns the original Pagination object.

perPage(Number:limit)

Sets the perPage limit for the seearch algorithm and then returns the original Pagination object.

previousPage()

Returns Number or Null

The page number for the previous page in the series or null if the current page isFirstPage.

results()

Returns Collection

The result set returned from the executed search. The type of collection will depend on the search algorithm in use:

total()

Returns Number

The total number of results available for the search including those not returned on the current page.

totalPages()

Returns Number

The total number of pages available for the search.