-
Notifications
You must be signed in to change notification settings - Fork 0
API PaginationManager
final class PaginationManager
Helper class for managing pagination
Since 1.0
public function __construct(IPaginationProvider $provider, array $extraParameterKeys = array())
Constructor
Since 1.0
Name | Type | Description |
---|---|---|
$provider |
IPaginationProvider |
Pagination information provider |
$extraParams |
array |
Extra parameter keys for further requests |
public function addCurrentPageDataValidatorFields(DataValidator $validator)
Adds current page parameters to the specified DataValidator instance
Since 1.0
Name | Type | Description |
---|---|---|
$validator |
DataValidator |
public function getCurrentPageIndex(): int
Computes the 0-based current page index
Since 1.0
int
public function getCurrentPageStart(): int
Tells the start index for the current page
Since 1.0
int
public function getCurrentPageURLParams(bool $includeExtraParameters = true): string
Gets the URL parameters for the current page
Since 1.0
Name | Type | Description |
---|---|---|
$includeExtraParameters |
boolean |
If set, includes the extra parameters in the URL params |
string
public function getItemCountPerPage(): int
Tells how many items should be displayed per page
Since 1.0
int
public function getPagesCount(): int
Tells how many pages exists
Since 1.0
int
public function getTotalItemCount(): int
Tells the total count of items
Since 1.0
int
public function hasNextPage(): bool
Tells if a next page exists
Since 1.0
boolean
public function hasPrevPage(): bool
Tells if a previous page exists
Since 1.0
boolean
public function nextPageStart(): int
Gets the next page start index
Since 1.0
int
public function nextPageURLParams(bool $includeExtraParameters = true): string
Gets the next page URL parameters
Since 1.0
Name | Type | Description |
---|---|---|
$includeExtraParameters |
boolean |
If set, includes the extra parameters in the URL params |
string
public function pageStart(int $pageIndex): int
Gets the start index of the specified page
Since 1.0
Name | Type | Description |
---|---|---|
$pageIndex |
int |
Page index |
int
public function pageURLParams(int $pageIndex, bool $includeExtraParameters = true): string
Get the URL parameters of the specified page
Since 1.0
Name | Type | Description |
---|---|---|
$pageIndex |
int |
Page index |
$includeExtraParameters |
bool |
If set, includes the extra parameters in the URL params |
string
public function prevPageStart(): int
Gets the previous page start index
Since 1.0
int
public function prevPageURLParams(bool $includeExtraParameters = true): string
Gets the previous page URL parameters
Since 1.0
Name | Type | Description |
---|---|---|
$includeExtraParameters |
boolean |
If set, includes the extra parameters in the URL params |
string
public function setExtraParameter(string $key, mixed $value)
Sets a registered extra parameter's value
Since 1.0
Name | Type | Description |
---|---|---|
$key |
string |
Extra parameter's key |
$value |
mixed |
A scalar value |
public function sqlLimit(): string
Generates a SQL LIMIT clause based on current page information
Since 1.0
string
Getting Started | Framework Reference | API Reference | MFX is released under the MIT license