class Paginator extends Object

Paginating math.

Properties

int $page
int $base
int $itemsPerPage
int|null $itemCount
int read-only $firstPage
int|null read-only $lastPage
bool read-only $first
bool read-only $last
int|null read-only $pageCount
int read-only $offset
int|null read-only $countdownOffset
int|null read-only $length

Methods

setPage($page)

Sets current page number.

int
getPage()

Returns current page number.

int
getFirstPage()

Returns first page number.

int|null
getLastPage()

Returns last page number.

setBase($base)

Sets first page (base) number.

int
getBase()

Returns first page (base) number.

int
getPageIndex()

Returns zero-based page number.

bool
isFirst()

Is the current page the first one?

bool
isLast()

Is the current page the last one?

int|null
getPageCount()

Returns the total number of pages.

setItemsPerPage($itemsPerPage)

Sets the number of items to display on a single page.

int
getItemsPerPage()

Returns the number of items to display on a single page.

setItemCount($itemCount)

Sets the total number of items.

int|null
getItemCount()

Returns the total number of items.

int
getOffset()

Returns the absolute index of the first item on current page.

int|null
getCountdownOffset()

Returns the absolute index of the first item on current page in countdown paging.

int|null
getLength()

Returns the number of items on current page.

Details

at line 51
Paginator setPage($page)

Sets current page number.

Parameters

$page

Return Value

Paginator

at line 62
int getPage()

Returns current page number.

Return Value

int

at line 72
int getFirstPage()

Returns first page number.

Return Value

int

at line 82
int|null getLastPage()

Returns last page number.

Return Value

int|null

at line 93
Paginator setBase($base)

Sets first page (base) number.

Parameters

$base

Return Value

Paginator

at line 104
int getBase()

Returns first page (base) number.

Return Value

int

at line 114
protected int getPageIndex()

Returns zero-based page number.

Return Value

int

at line 125
bool isFirst()

Is the current page the first one?

Return Value

bool

at line 135
bool isLast()

Is the current page the last one?

Return Value

bool

at line 145
int|null getPageCount()

Returns the total number of pages.

Return Value

int|null

at line 156
Paginator setItemsPerPage($itemsPerPage)

Sets the number of items to display on a single page.

Parameters

$itemsPerPage

Return Value

Paginator

at line 167
int getItemsPerPage()

Returns the number of items to display on a single page.

Return Value

int

at line 178
Paginator setItemCount($itemCount)

Sets the total number of items.

Parameters

$itemCount

Return Value

Paginator

at line 189
int|null getItemCount()

Returns the total number of items.

Return Value

int|null

at line 199
int getOffset()

Returns the absolute index of the first item on current page.

Return Value

int

at line 209
int|null getCountdownOffset()

Returns the absolute index of the first item on current page in countdown paging.

Return Value

int|null

at line 221
int|null getLength()

Returns the number of items on current page.

Return Value

int|null