QubitPager
in package
implements
Countable, IteratorAggregate
Table of Contents
Interfaces
- Countable
- IteratorAggregate
Methods
- __construct() : mixed
- count() : int
- Countable interface — returns total number of results.
- getCriteria() : Criteria|null
- Get the Criteria.
- getFirstIndice() : int
- Get the first indice (1-indexed position of first item on page).
- getFirstPage() : int
- Get first page number.
- getIterator() : ArrayIterator
- IteratorAggregate interface — iterate over current page results.
- getLastIndice() : int
- Get the last indice (1-indexed position of last item on page).
- getLastPage() : int
- Get last page number.
- getLinks() : array<string|int, mixed>
- Get page links for pagination UI.
- getMaxPerPage() : int
- Get max results per page.
- getNbPages() : int
- Get total number of pages.
- getNbResults() : int
- Get total number of results.
- getNextPage() : int
- Get next page number.
- getPage() : int
- Get current page number.
- getPreviousPage() : int
- Get previous page number.
- getResults() : array<string|int, mixed>
- Get paginated results, hydrated as model instances.
- haveToPaginate() : bool
- Check if pagination is needed.
- init() : void
- Initialize the pager (run count query).
- isFirstPage() : bool
- Check if we're on the first page.
- isLastPage() : bool
- Check if we're on the last page.
- setCriteria() : void
- Set the Criteria for this pager.
- setMaxPerPage() : void
- Set max results per page.
- setPage() : void
- Set current page number (1-indexed).
Methods
__construct()
public
__construct(string $class) : mixed
Parameters
- $class : string
-
The Qubit model class name (e.g. 'QubitPhysicalObject')
count()
Countable interface — returns total number of results.
public
count() : int
Return values
intgetCriteria()
Get the Criteria.
public
getCriteria() : Criteria|null
Return values
Criteria|nullgetFirstIndice()
Get the first indice (1-indexed position of first item on page).
public
getFirstIndice() : int
Return values
intgetFirstPage()
Get first page number.
public
getFirstPage() : int
Return values
intgetIterator()
IteratorAggregate interface — iterate over current page results.
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetLastIndice()
Get the last indice (1-indexed position of last item on page).
public
getLastIndice() : int
Return values
intgetLastPage()
Get last page number.
public
getLastPage() : int
Return values
intgetLinks()
Get page links for pagination UI.
public
getLinks([int $nbLinks = 5 ]) : array<string|int, mixed>
Returns an array of page numbers to display.
Parameters
- $nbLinks : int = 5
-
Number of page links to show
Return values
array<string|int, mixed>getMaxPerPage()
Get max results per page.
public
getMaxPerPage() : int
Return values
intgetNbPages()
Get total number of pages.
public
getNbPages() : int
Return values
intgetNbResults()
Get total number of results.
public
getNbResults() : int
Return values
intgetNextPage()
Get next page number.
public
getNextPage() : int
Return values
intgetPage()
Get current page number.
public
getPage() : int
Return values
intgetPreviousPage()
Get previous page number.
public
getPreviousPage() : int
Return values
intgetResults()
Get paginated results, hydrated as model instances.
public
getResults() : array<string|int, mixed>
Return values
array<string|int, mixed>haveToPaginate()
Check if pagination is needed.
public
haveToPaginate() : bool
Return values
boolinit()
Initialize the pager (run count query).
public
init() : void
Propel pagers require init() before use. Here we run the count query to determine total results.
isFirstPage()
Check if we're on the first page.
public
isFirstPage() : bool
Return values
boolisLastPage()
Check if we're on the last page.
public
isLastPage() : bool
Return values
boolsetCriteria()
Set the Criteria for this pager.
public
setCriteria(Criteria $criteria) : void
Parameters
- $criteria : Criteria
setMaxPerPage()
Set max results per page.
public
setMaxPerPage(int $max) : void
Parameters
- $max : int
setPage()
Set current page number (1-indexed).
public
setPage(int $page) : void
Parameters
- $page : int