interface PaginationInterface implements JsonSerializable

Pagination interface.

Methods

__construct(int $items, int $itemsPerPage, int $currentPage, array $options = [])

Constructor.

int
items()

Returns the number of items.

int
itemsPerPage()

Returns the number of items per page.

int
currentPage()

Returns the current page.

int
numberOfPages()

Returns the number pages.

bool
isValidPage()

Returns true if we're on a valid page and false if not.

int
limit()

Returns the limit.

int
offset()

Returns the offset.

array
toArray()

Returns an array representation of the pagination object.

string
toJson(int $options = 0)

Returns a json representation of the pagination object.

Details

at line 28
__construct(int $items, int $itemsPerPage, int $currentPage, array $options = [])

Constructor.

Parameters

int $items Number of items
int $itemsPerPage Number of items per page
int $currentPage The current page
array $options Pagination options

at line 35
int items()

Returns the number of items.

Return Value

int

at line 42
int itemsPerPage()

Returns the number of items per page.

Return Value

int

at line 49
int currentPage()

Returns the current page.

Return Value

int

at line 56
int numberOfPages()

Returns the number pages.

Return Value

int

at line 63
bool isValidPage()

Returns true if we're on a valid page and false if not.

Return Value

bool

at line 70
int limit()

Returns the limit.

Return Value

int

at line 77
int offset()

Returns the offset.

Return Value

int

at line 84
array toArray()

Returns an array representation of the pagination object.

Return Value

array

at line 92
string toJson(int $options = 0)

Returns a json representation of the pagination object.

Parameters

int $options JSON encode options

Return Value

string