PaginationService
class PaginationService (View source)
Constants
| MIN_ROWS_PER_PAGE |
Lower and upper bounds for a usable page size; shared with UserPreferenceService. |
| MAX_ROWS_PER_PAGE |
|
| ROWS_PER_PAGE_PRESETS |
Offered in the page-size dropdowns; any value within the bounds is still honoured. |
| DEFAULT_ROWS_PER_PAGE |
Used when nothing usable was supplied; matches interface.rows_per_page's default. |
Methods
createPagination(int $totalItems, int $itemsPerPage, int $currentPage)
Create a pagination object with proper validation
int
getUserRowsPerPage(int $defaultRowsPerPage, int|null $userId = null)
Get user preference for items per page with validation
array
getRowsPerPageOptions(int ...$extra)
Page sizes to offer, so the current and configured values are always selectable.
Details
__construct(UserPreferenceService|null $userPreferenceService = null)
No description
Pagination
createPagination(int $totalItems, int $itemsPerPage, int $currentPage)
Create a pagination object with proper validation
int
getUserRowsPerPage(int $defaultRowsPerPage, int|null $userId = null)
Get user preference for items per page with validation
array
getRowsPerPageOptions(int ...$extra)
Page sizes to offer, so the current and configured values are always selectable.