AbstractPagination
in package
implements
PaginationInterface
Class AbstractPagination
Table of Contents
Interfaces
- PaginationInterface
- Interface PaginationInterface
Properties
- $defaultOptions : array<string|int, mixed>
- $limit : int
- $options : array<string|int, mixed>
- $page : int|null
- $pages : int
- $pagesStart : int
- $pagesStop : int
- $route : Route
- $start : int|null
- $total : int
- $viewAll : bool
- $items : array<string|int, mixed>
Methods
- count() : int
- getFirstPage() : PaginationPage|null
- getIterator() : ArrayIterator
- getLastPage() : PaginationPage|null
- getLimit() : int
- getNextNumber() : int|null
- getNextPage() : PaginationPage|null
- getOptions() : array<string|int, mixed>
- getPage() : PaginationPage|null
- getPageNumber() : int
- getPages() : array<string|int, mixed>
- getPrevNumber() : int|null
- getPrevPage() : PaginationPage|null
- getRoute() : Route|null
- getStart() : int
- getTotal() : int
- getTotalPages() : int
- isEnabled() : bool
- calculateLimits() : void
- calculateRange() : void
- initialize() : void
- loadItems() : void
- setLimit() : $this
- setOptions() : $this
- setPage() : $this
- setRoute() : $this
- setStart() : $this
- setTotal() : $this
Properties
$defaultOptions
protected
array<string|int, mixed>
$defaultOptions
= ['type' => 'page', 'limit' => 10, 'display' => 5, 'opening' => 0, 'ending' => 0, 'url' => null, 'param' => null, 'use_query_param' => false]
$limit
protected
int
$limit
Number of records to display per page.
$options
protected
array<string|int, mixed>
$options
Pagination options
$page
protected
int|null
$page
Current page.
$pages
protected
int
$pages
Total number of pages.
$pagesStart
protected
int
$pagesStart
Value pagination object begins at.
$pagesStop
protected
int
$pagesStop
Value pagination object ends at .
$route
protected
Route
$route
Base rouse used for the pagination.
$start
protected
int|null
$start
The record number to start displaying from.
$total
protected
int
$total
Total number of records.
$viewAll
protected
bool
$viewAll
View all flag.
$items
private
array<string|int, mixed>
$items
Methods
count()
public
count() : int
Return values
intgetFirstPage()
public
getFirstPage([string|null $label = null ][, int $count = 0 ]) : PaginationPage|null
Parameters
- $label : string|null = null
- $count : int = 0
Return values
PaginationPage|nullgetIterator()
public
getIterator() : ArrayIterator
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
ArrayIteratorgetLastPage()
public
getLastPage([string|null $label = null ][, int $count = 0 ]) : PaginationPage|null
Parameters
- $label : string|null = null
- $count : int = 0
Return values
PaginationPage|nullgetLimit()
public
getLimit() : int
Return values
intgetNextNumber()
public
getNextNumber([int $count = 1 ]) : int|null
Parameters
- $count : int = 1
Return values
int|nullgetNextPage()
public
getNextPage([string|null $label = null ][, int $count = 1 ]) : PaginationPage|null
Parameters
- $label : string|null = null
- $count : int = 1
Return values
PaginationPage|nullgetOptions()
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getPage()
public
getPage(int $page[, string|null $label = null ]) : PaginationPage|null
Parameters
- $page : int
- $label : string|null = null
Return values
PaginationPage|nullgetPageNumber()
public
getPageNumber() : int
Return values
intgetPages()
public
getPages() : array<string|int, mixed>
Return values
array<string|int, mixed>getPrevNumber()
public
getPrevNumber([int $count = 1 ]) : int|null
Parameters
- $count : int = 1
Return values
int|nullgetPrevPage()
public
getPrevPage([string|null $label = null ][, int $count = 1 ]) : PaginationPage|null
Parameters
- $label : string|null = null
- $count : int = 1
Return values
PaginationPage|nullgetRoute()
public
getRoute() : Route|null
Return values
Route|nullgetStart()
public
getStart() : int
Return values
intgetTotal()
public
getTotal() : int
Return values
intgetTotalPages()
public
getTotalPages() : int
Return values
intisEnabled()
public
isEnabled() : bool
Return values
boolcalculateLimits()
protected
calculateLimits() : void
calculateRange()
protected
calculateRange() : void
initialize()
protected
initialize(Route $route, int $total[, int|null $pos = null ][, int|null $limit = null ][, array<string|int, mixed>|null $options = null ]) : void
Parameters
- $route : Route
- $total : int
- $pos : int|null = null
- $limit : int|null = null
- $options : array<string|int, mixed>|null = null
loadItems()
protected
loadItems() : void
setLimit()
protected
setLimit([int|null $limit = null ]) : $this
Parameters
- $limit : int|null = null
Return values
$thissetOptions()
protected
setOptions([array<string|int, mixed>|null $options = null ]) : $this
Parameters
- $options : array<string|int, mixed>|null = null
Return values
$thissetPage()
protected
setPage([int|null $page = null ]) : $this
Parameters
- $page : int|null = null
Return values
$thissetRoute()
protected
setRoute(Route $route) : $this
Parameters
- $route : Route
Return values
$thissetStart()
protected
setStart([int|null $start = null ]) : $this
Parameters
- $start : int|null = null
Return values
$thissetTotal()
protected
setTotal(int $total) : $this
Parameters
- $total : int