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 25
__construct(int $items, int $itemsPerPage, int $currentPage, array $options = [])
Constructor.
at line 32
int
items()
Returns the number of items.
at line 39
int
itemsPerPage()
Returns the number of items per page.
at line 46
int
currentPage()
Returns the current page.
at line 53
int
numberOfPages()
Returns the number pages.
at line 60
bool
isValidPage()
Returns TRUE if we're on a valid page and FALSE if not.
at line 67
int
limit()
Returns the limit.
at line 74
int
offset()
Returns the offset.
at line 81
array
toArray()
Returns an array representation of the pagination object.
at line 89
string
toJson(int $options = 0)
Returns a json representation of the pagination object.