SlidingWindowPagination implements PaginationInterface
Table of Contents
Interfaces
- PaginationInterface
- An interface that defines methods needed to implement a pagination
Properties
- $displayRangeEnd : int
- $displayRangeStart : int
- $hasLessPages : bool
- $hasMorePages : bool
- $maximumNumberOfLinks : int
- $paginator : PaginatorInterface
Methods
- __construct() : mixed
- getAllPageNumbers() : array<string|int, int>
- Must return a list of all page numbers.
- getDisplayRangeEnd() : int
- getDisplayRangeStart() : int
- getEndRecordNumber() : int
- Must return the human-readable index of the last paginated item
- getFirstPageNumber() : int
- Must return the first page number, usually this will return 1
- getHasLessPages() : bool
- getHasMorePages() : bool
- getLastPageNumber() : int
- Must return the last page number, usually this will return the total amount of pages
- getMaximumNumberOfLinks() : int
- getNextPageNumber() : int|null
- Must return the next page number
- getPaginator() : PaginatorInterface
- getPreviousPageNumber() : int|null
- Must return the previous page number
- getStartRecordNumber() : int
- Must return the human-readable index of the first paginated item
- calculateDisplayRange() : void
Properties
$displayRangeEnd
protected
int
$displayRangeEnd
= 0
$displayRangeStart
protected
int
$displayRangeStart
= 0
$hasLessPages
protected
bool
$hasLessPages
= false
$hasMorePages
protected
bool
$hasMorePages
= false
$maximumNumberOfLinks
protected
int
$maximumNumberOfLinks
= 0
$paginator
protected
PaginatorInterface
$paginator
Methods
__construct()
public
__construct(PaginatorInterface $paginator[, int $maximumNumberOfLinks = 0 ]) : mixed
Parameters
- $paginator : PaginatorInterface
- $maximumNumberOfLinks : int = 0
getAllPageNumbers()
Must return a list of all page numbers.
public
getAllPageNumbers() : array<string|int, int>
Return values
array<string|int, int>getDisplayRangeEnd()
public
getDisplayRangeEnd() : int
Return values
intgetDisplayRangeStart()
public
getDisplayRangeStart() : int
Return values
intgetEndRecordNumber()
Must return the human-readable index of the last paginated item
public
getEndRecordNumber() : int
Example: given a set of 10 total items, 5 items per page and the current page being 2, the end record number is 10.
Page 1: Records 1-5 Page 2: Records 6-10
Return values
intgetFirstPageNumber()
Must return the first page number, usually this will return 1
public
getFirstPageNumber() : int
Return values
intgetHasLessPages()
public
getHasLessPages() : bool
Return values
boolgetHasMorePages()
public
getHasMorePages() : bool
Return values
boolgetLastPageNumber()
Must return the last page number, usually this will return the total amount of pages
public
getLastPageNumber() : int
Return values
intgetMaximumNumberOfLinks()
public
getMaximumNumberOfLinks() : int
Return values
intgetNextPageNumber()
Must return the next page number
public
getNextPageNumber() : int|null
Is allowed to return null to indicate that there is no next page, e.g. when being on the last page
Return values
int|nullgetPaginator()
public
getPaginator() : PaginatorInterface
Return values
PaginatorInterfacegetPreviousPageNumber()
Must return the previous page number
public
getPreviousPageNumber() : int|null
Is allowed to return null to indicate that there is no previous page, e.g. when being on the first page
Return values
int|nullgetStartRecordNumber()
Must return the human-readable index of the first paginated item
public
getStartRecordNumber() : int
Example: given a set of 10 total items, 5 items per page and the current page being 2, the start record number is 6:
Page 1: Records 1-5 Page 2: Records 6-10
Return values
intcalculateDisplayRange()
protected
calculateDisplayRange() : void