evaneos/berthe

The model Framework made by Evaneos

v6.2.0 2013-10-11 00:00 UTC

README

Utils

Buffered Iterator

Useful when your logic can directly process a batch of result instead of one by one

$bufferIterator = new BufferedIterator(new FetcherIterator(new Service(), new FetcherBuilder(), 100);

foreach($bufferIterator as $results){
    dump($results); //contains 100 items
    
    $resource = new Resource($results, $composerName);
    $composed = $composerManager->compose($resource);
    $composedResource = $composed->getComposite();
    $composedResource = new Collection($composedResource, $transformer);
    $transformedRessource = $fractal->createData($composedResource)->toArray();
    
    //got your transformed batch instead of processing one by one or any overhead
}