Detailed Description
PagingInfo contains information about a paged list.
Definition at line 18 of file PagingInfo.php.
Public Member Functions | |
__construct ($pageSize, $ignoreTotalCount=false) | |
setTotalCount ($totalCount) | |
getTotalCount () | |
setPage ($page) | |
getPage () | |
getPageSize () | |
getPageCount () | |
setOffset ($offset) | |
getOffset () | |
isOnFirstPage () | |
isOnLastPage () | |
isIgnoringTotalCount () | |
getPagination ($urlPattern, $maxDisplayPages=10) | |
Public Attributes | |
const | SIZE_INFINITE = -1 |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | $pageSize, | |
$ignoreTotalCount = false |
|||
) |
Creates a PagingInfo object.
The ignoreTotalCount parameter may be set to true, if the count is to be ignored. This may speed up loading of objects, because an extra count query may be omitted.
- Parameters
-
$pageSize The pageSize (PagingInfo::SIZE_INFINITE to set no page size) $ignoreTotalCount Boolean whether this instance ignores the total count or not (optional, default: false)
Definition at line 36 of file PagingInfo.php.
Member Function Documentation
◆ setTotalCount()
setTotalCount | ( | $totalCount | ) |
Set the number of list items.
- Parameters
-
$totalCount The number of list items.
Definition at line 48 of file PagingInfo.php.
◆ getTotalCount()
getTotalCount | ( | ) |
◆ setPage()
setPage | ( | $page | ) |
Set the current page (1-based) (also sets the offset).
- Parameters
-
$page The current page.
Definition at line 64 of file PagingInfo.php.
◆ getPage()
getPage | ( | ) |
◆ getPageSize()
getPageSize | ( | ) |
◆ getPageCount()
getPageCount | ( | ) |
◆ setOffset()
setOffset | ( | $offset | ) |
Set the current offset (also selects the page).
- Parameters
-
$offset The current list offset.
Definition at line 97 of file PagingInfo.php.
◆ getOffset()
getOffset | ( | ) |
◆ isOnFirstPage()
isOnFirstPage | ( | ) |
Determine if we are on the first page.
- Returns
- Boolean
Definition at line 114 of file PagingInfo.php.
◆ isOnLastPage()
isOnLastPage | ( | ) |
Determine if we are on the first page.
- Returns
- Boolean
Definition at line 122 of file PagingInfo.php.
◆ isIgnoringTotalCount()
isIgnoringTotalCount | ( | ) |
Check if this instance iignores the total count.
- Returns
- Boolean
Definition at line 130 of file PagingInfo.php.
◆ getPagination()
getPagination | ( | $urlPattern, | |
$maxDisplayPages = 10 |
|||
) |
Get the pages for a pagination navigation.
- Parameters
-
$urlPattern Url string to use containing literal {page}, that will be replaced $maxDisplayPages Maximum number of pages to display (optional, default: 10)
- Returns
- Array with keys 'first', 'last', 'current', 'prev', 'next', 'pages' and arrays with 'url', 'num' as values or null, if page count <= 1
Definition at line 140 of file PagingInfo.php.
Member Data Documentation
◆ SIZE_INFINITE
const SIZE_INFINITE = -1 |
Definition at line 20 of file PagingInfo.php.