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 25
__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 32
int items()

Returns the number of items.

Return Value

int

at line 39
int itemsPerPage()

Returns the number of items per page.

Return Value

int

at line 46
int currentPage()

Returns the current page.

Return Value

int

at line 53
int numberOfPages()

Returns the number pages.

Return Value

int

at line 60
bool isValidPage()

Returns TRUE if we're on a valid page and FALSE if not.

Return Value

bool

at line 67
int limit()

Returns the limit.

Return Value

int

at line 74
int offset()

Returns the offset.

Return Value

int

at line 81
array toArray()

Returns an array representation of the pagination object.

Return Value

array

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

Returns a json representation of the pagination object.

Parameters

int $options JSON encode options

Return Value

string