No description, website, or topics provided.
PHP
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
src/Berthe
test
.gitignore
.travis.yml
LICENSE
README.md
TODO
composer.json

README.md

berthe Travis

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
}