pioniro/pagination

simple bundle for pagination purpose

Installs: 191

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/pioniro/pagination

v1.1.1 2019-10-21 11:16 UTC

This package is auto-updated.

Last update: 2025-09-25 21:33:46 UTC


README

Build Status Coverage Status

Install

composer require pioniro/pagination

##Usage

use Pioniro\Pagination\Pagination\QueryBuilderPagination;
use Pioniro\Pagination\Pager\CursorPager;

// give me 10 items after item(id=15)
$pager = new CursorPager(10, null, 15);

$qb = $entityManager
    ->createQueryBuilder('App:Item', 'i')
    ->orderBy('i.id', 'ASC');

$pagination = new QueryBuilderPagination($qb, $pager);
// items can be obtained
foreach ($pagination as $item) {
    // ...
}
// OR
foreach ($pagination->getItems() as $item) {
    // ...
}
// new Pager same type as $pager
$pagination->getPager();