Download the PHP package silarhi/cursor-pagination without Composer
On this page you can find all versions of the php package silarhi/cursor-pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download silarhi/cursor-pagination
More information about silarhi/cursor-pagination
Files in silarhi/cursor-pagination
Download silarhi/cursor-pagination
More information about silarhi/cursor-pagination
Files in silarhi/cursor-pagination
Vendor silarhi
Package cursor-pagination
Short Description A doctrine ORM cursor based pagination library for faster batch operations.
License MIT
Package cursor-pagination
Short Description A doctrine ORM cursor based pagination library for faster batch operations.
License MIT
Please rate this library. Is it a good library?
Informations about the package cursor-pagination
A doctrine ORM cursor based pagination library for faster batch operations
Installation
Usage
use Silarhi\CursorPagination\Pagination\CursorPagination;
$queryBuilder = $entityManager
->createQueryBuilder('u')
->from(User::class, 'u')
->where('u.foo = true');
$configurations = new OrderConfigurations(
new OrderConfiguration('u.createdAt', fn (User $user) => $user->getCreatedAt()),
new OrderConfiguration('u.id', fn (User $user) => $user->getId()),
);
/** @var CursorPagination<User> $pagination */
$pagination = new CursorPagination($queryBuilder, $configurations, 100);
// Method 1: get results as chunk (recommended)
foreach($pagination->getChunkResults() as $results) {
foreach($results as $user) {
// do something with user
}
$entityManager->flush();
$entityManager->clear();
}
// Method 2: get single result as iterator
foreach($pagination->getResults() as $user) {
// do something with user
}
``
All versions of cursor-pagination with dependencies
PHP Build Version
Package Version
The package silarhi/cursor-pagination contains the following files
Loading the files please wait ....