2017 © Pedro Peláez
 

library doctrine-orm-query-builder-iterator

image

webit/doctrine-orm-query-builder-iterator

  • Sunday, January 7, 2018
  • by dbojdo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 14 % Grown

The README.md

Doctrine ORM Query Builder Iterator

Allows to iterate over Query Builder Results in batches, (*1)

Installation

composer require webit/doctrine-orm-query-builder-iterator=^1.0.0

Usage

<?php
use Webit\DoctrineORM\QueryBuilder\Iterator\QueryBuilderIterator;

/** @var \Doctrine\ORM\EntityManagerInterface $entityManager */

$queryBuilder = $entityManager->getRepository('MyEntity')->createQueryBuilder();
$queryBuilder->orderBy('a.ble', 'DESC');

$iterator = new QueryBuilderIterator(
    $queryBuilder,
    20, // iterates in 50 elements batches (50 by default)
    array('MyEntity') // clears entity manager before getting next batch for listed entities (empty by default) 
);

foreach ($iterator as $entity) {
    // do your stuff with the entity
}

Tests

composer install
./vendor/bin/phpunit

The Versions

07/01 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

07/01 2018

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires