avn/paginator

There is no license information available for the latest version (0.1.0) of this package.

Paginator

0.1.0 2022-10-16 20:23 UTC

This package is auto-updated.

Last update: 2024-12-17 09:50:27 UTC


README

How to use

$idList = $someRepository->getIdList(); // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

$pagination = new Paginator(
    (new PaginatorRequest($idList))
        ->setCurrentPage(3)
        ->setLimit(2)
)

$totalPageCount = $pagination->getTotalPageCount(); // 5
$resultIdList = $pagination->getIdList(); // [5, 6]