Skip to content
Snippets Groups Projects
Commit d6f6b180 authored by Tobias Gross-Vogt's avatar Tobias Gross-Vogt
Browse files

pagination helper function

parent 7ed81087
No related branches found
No related tags found
No related merge requests found
......@@ -21,4 +21,9 @@ class Pagination
{
return max(1, intval($options[self::MAX_NUM_ITEMS_PER_PAGE_PARAMETER_NAME] ?? self::MAX_NUM_ITEMS_PER_PAGE_DEFAULT));
}
public static function getFirstItemIndex(int $currentPageNumber, int $maxNumItemsPerPage)
{
return max(0, ($currentPageNumber - 1) * $maxNumItemsPerPage);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment