Pager
class Pager (View source)
A value object that represents a pager.
Properties
| protected int | $totalItems | The total number of items . |
|
| protected int | $totalPages | The total number of pages. |
|
| protected int | $currentPage | The current page of the pager. |
|
| protected int | $limit | The maximum number of items per page. |
Methods
Pager constructor.
Sets the current page to a valid value within range.
Sets the total number of pages.
Gets the total number of items.
Gets the total number of pages.
Gets the current page.
Gets the maximum number of items per page.
Details
__construct(int $totalItems, int $limit, int $currentPage = 0)
Pager constructor.
protected
setCurrentPage(int $currentPage = 0)
Sets the current page to a valid value within range.
If a page that does not correspond to the actual range of the result set was provided, this function will set the closest page actually within the result set.
protected
setTotalPages(int $totalItems, int $limit)
Sets the total number of pages.
int
getTotalItems()
Gets the total number of items.
int
getTotalPages()
Gets the total number of pages.
int
getCurrentPage()
Gets the current page.
int
getLimit()
Gets the maximum number of items per page.