Documentation

Paginator
in package
uses SmartObject

Paginating math.

Table of Contents

Properties

$countdownOffset  : int<0, max>|null
$first  : bool
$firstItemOnPage  : int<0, max>
$firstPage  : int
$last  : bool
$lastItemOnPage  : int<0, max>
$lastPage  : int|null
$length  : int<0, max>
$offset  : int<0, max>
$pageCount  : int<0, max>|null
$base  : int
$itemCount  : int<0, max>|null
$itemsPerPage  : positive-int
$page  : int

Methods

__call()  : mixed
__callStatic()  : mixed
__get()  : mixed
__isset()  : bool
__set()  : void
__unset()  : void
getBase()  : int
Returns first page (base) number.
getCountdownOffset()  : int<0, max>|null
Returns the absolute index of the first item on current page in countdown paging.
getFirstItemOnPage()  : int<0, max>
Returns the sequence number of the first element on the page
getFirstPage()  : int
Returns first page number.
getItemCount()  : int<0, max>|null
Returns the total number of items.
getItemsPerPage()  : positive-int
Returns the number of items to display on a single page.
getLastItemOnPage()  : int<0, max>
Returns the sequence number of the last element on the page
getLastPage()  : int|null
Returns last page number.
getLength()  : int<0, max>
Returns the number of items on current page.
getOffset()  : int<0, max>
Returns the absolute index of the first item on current page.
getPage()  : int
Returns current page number.
getPageCount()  : int<0, max>|null
Returns the total number of pages.
isFirst()  : bool
Is the current page the first one?
isLast()  : bool
Is the current page the last one?
setBase()  : static
Sets first page (base) number.
setItemCount()  : static
Sets the total number of items.
setItemsPerPage()  : static
Sets the number of items to display on a single page.
setPage()  : static
Sets current page number.
getPageIndex()  : int<0, max>
Returns zero-based page number.

Properties

$countdownOffset read-only

public int<0, max>|null $countdownOffset

$firstItemOnPage read-only

public int<0, max> $firstItemOnPage

$lastItemOnPage read-only

public int<0, max> $lastItemOnPage

$lastPage read-only

public int|null $lastPage

$pageCount read-only

public int<0, max>|null $pageCount

$itemCount

private int<0, max>|null $itemCount = null

$itemsPerPage

private positive-int $itemsPerPage = 1

Methods

__call()

public __call(string $name, array<string|int, mixed> $args) : mixed
Parameters
$name : string
$args : array<string|int, mixed>
Tags
throws
MemberAccessException

__callStatic()

public static __callStatic(string $name, array<string|int, mixed> $args) : mixed
Parameters
$name : string
$args : array<string|int, mixed>
Tags
throws
MemberAccessException

__isset()

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed
Tags
throws
MemberAccessException

if the property is not defined or is read-only

getBase()

Returns first page (base) number.

public getBase() : int
Return values
int

getCountdownOffset()

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

public getCountdownOffset() : int<0, max>|null
Return values
int<0, max>|null

getFirstItemOnPage()

Returns the sequence number of the first element on the page

public getFirstItemOnPage() : int<0, max>
Return values
int<0, max>

getFirstPage()

Returns first page number.

public getFirstPage() : int
Return values
int

getItemCount()

Returns the total number of items.

public getItemCount() : int<0, max>|null
Return values
int<0, max>|null

getItemsPerPage()

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

public getItemsPerPage() : positive-int
Return values
positive-int

getLastItemOnPage()

Returns the sequence number of the last element on the page

public getLastItemOnPage() : int<0, max>
Return values
int<0, max>

getLastPage()

Returns last page number.

public getLastPage() : int|null
Return values
int|null

getLength()

Returns the number of items on current page.

public getLength() : int<0, max>
Return values
int<0, max>

getOffset()

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

public getOffset() : int<0, max>
Return values
int<0, max>

getPage()

Returns current page number.

public getPage() : int
Return values
int

getPageCount()

Returns the total number of pages.

public getPageCount() : int<0, max>|null
Return values
int<0, max>|null

isFirst()

Is the current page the first one?

public isFirst() : bool
Return values
bool

isLast()

Is the current page the last one?

public isLast() : bool
Return values
bool

setBase()

Sets first page (base) number.

public setBase(int $base) : static
Parameters
$base : int
Return values
static

setItemCount()

Sets the total number of items.

public setItemCount([int|null $itemCount = null ]) : static
Parameters
$itemCount : int|null = null
Return values
static

setItemsPerPage()

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

public setItemsPerPage(int $itemsPerPage) : static
Parameters
$itemsPerPage : int
Return values
static

setPage()

Sets current page number.

public setPage(int $page) : static
Parameters
$page : int
Return values
static

getPageIndex()

Returns zero-based page number.

protected getPageIndex() : int<0, max>
Return values
int<0, max>

        
On this page

Search results