PaginationInterface
interface PaginationInterface implements JsonSerializable
Pagination interface.
Methods
Constructor.
Returns the number of items.
Returns the number of items per page.
Returns the current page.
Returns the number pages.
Returns TRUE if we're on a valid page and FALSE if not.
Returns the limit.
Returns the offset.
Returns an array representation of the pagination object.
Returns a json representation of the pagination object.
Details
at line 28
__construct(int $items, int $itemsPerPage, int $currentPage, array $options = [])
Constructor.
at line 35
int
items()
Returns the number of items.
at line 42
int
itemsPerPage()
Returns the number of items per page.
at line 49
int
currentPage()
Returns the current page.
at line 56
int
numberOfPages()
Returns the number pages.
at line 63
bool
isValidPage()
Returns TRUE if we're on a valid page and FALSE if not.
at line 70
int
limit()
Returns the limit.
at line 77
int
offset()
Returns the offset.
at line 84
array
toArray()
Returns an array representation of the pagination object.
at line 92
string
toJson(int $options = 0)
Returns a json representation of the pagination object.