naroga / doctrine-paginator-bundle
Installs: 1 098
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.5
- doctrine/orm: ^2.5
README
Creates beautiful pagination objects for Doctrine.
Installation
$ composer require naroga/doctrine-paginator-bundle
Usage
<?php
use Naroga\DoctrinePaginatorBundle\Paginator;
$paginator = new Paginator;
$qBuilder = $entityManager
->createQueryBuilder()
->select('q')
->from(MyEntity::class);
$result = $paginator->paginate($qBuilder, 1, 10);
var_dump($result);
/* Object (Page) {
page: 1,
totalItems: 58,
pageItems: 10,
totalPages: 6,
items: [...]
}*/