adt / bulk-fetcher
v6.0
2026-08-13 16:24 UTC
Requires
- php: ^8.1
- doctrine/orm: ^3.0
- nette/utils: ^3.0 || ^4.0
This package is auto-updated.
Last update: 2026-08-13 16:24:40 UTC
README
\ADT\BulkFetcher\Factory can be used with:
\Kdyby\Doctrine\ResultSet\Doctrine\ORM\QueryBuilder\Kdyby\Doctrine\NativeQueryBuilder
Installation
via composer:
composer require adt/bulk-fetcher
Full example
Whole batch is in transaction.
$qb = $entityManager->createQueryBuilder('user'); try { $entityManager->beginTransaction(); $data = \ADT\BulkFetcher\Factory::create($qb, 100); $data->onBeforeFetch[] = function() use ($entityManager) { $entityManager->commit(); $entityManager->clear(); $entityManager->beginTransaction(); }; foreach ($data as $key => $row) { // code } $entityManager->commit(); } catch (\Exception $e) { $entityManager->rollback(); throw $e; }