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
$first read-only
public
bool
$first
$firstItemOnPage read-only
public
int<0, max>
$firstItemOnPage
$firstPage read-only
public
int
$firstPage
$last read-only
public
bool
$last
$lastItemOnPage read-only
public
int<0, max>
$lastItemOnPage
$lastPage read-only
public
int|null
$lastPage
$length read-only
public
int<0, max>
$length
$offset read-only
public
int<0, max>
$offset
$pageCount read-only
public
int<0, max>|null
$pageCount
$base
private
int
$base
= 1
$itemCount
private
int<0, max>|null
$itemCount
= null
$itemsPerPage
private
positive-int
$itemsPerPage
= 1
$page
private
int
$page
= 1
Methods
__call()
public
__call(string $name, array<string|int, mixed> $args) : mixed
Parameters
- $name : string
- $args : array<string|int, mixed>
Tags
__callStatic()
public
static __callStatic(string $name, array<string|int, mixed> $args) : mixed
Parameters
- $name : string
- $args : array<string|int, mixed>
Tags
__get()
public
& __get(string $name) : mixed
Parameters
- $name : string
Tags
__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
__unset()
public
__unset(string $name) : void
Parameters
- $name : string
Tags
getBase()
Returns first page (base) number.
public
getBase() : int
Return values
intgetCountdownOffset()
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>|nullgetFirstItemOnPage()
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
intgetItemCount()
Returns the total number of items.
public
getItemCount() : int<0, max>|null
Return values
int<0, max>|nullgetItemsPerPage()
Returns the number of items to display on a single page.
public
getItemsPerPage() : positive-int
Return values
positive-intgetLastItemOnPage()
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|nullgetLength()
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
intgetPageCount()
Returns the total number of pages.
public
getPageCount() : int<0, max>|null
Return values
int<0, max>|nullisFirst()
Is the current page the first one?
public
isFirst() : bool
Return values
boolisLast()
Is the current page the last one?
public
isLast() : bool
Return values
boolsetBase()
Sets first page (base) number.
public
setBase(int $base) : static
Parameters
- $base : int
Return values
staticsetItemCount()
Sets the total number of items.
public
setItemCount([int|null $itemCount = null ]) : static
Parameters
- $itemCount : int|null = null
Return values
staticsetItemsPerPage()
Sets the number of items to display on a single page.
public
setItemsPerPage(int $itemsPerPage) : static
Parameters
- $itemsPerPage : int
Return values
staticsetPage()
Sets current page number.
public
setPage(int $page) : static
Parameters
- $page : int
Return values
staticgetPageIndex()
Returns zero-based page number.
protected
getPageIndex() : int<0, max>