PHP code example of evaneos / berthe

1. Go to this page and download the library: Download evaneos/berthe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

evaneos / berthe example snippets


$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
}