Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evaneos/berthe
https://github.com/evaneos/berthe
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/evaneos/berthe
- Owner: Evaneos
- License: lgpl-3.0
- Created: 2013-09-26T15:46:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-03-22T11:56:48.000Z (almost 3 years ago)
- Last Synced: 2024-09-18T00:38:46.007Z (4 months ago)
- Language: PHP
- Size: 382 KB
- Stars: 1
- Watchers: 27
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
berthe [![Travis](https://img.shields.io/travis/Evaneos/berthe.svg?branch=master)](https://travis-ci.org/Evaneos/berthe)
======# Utils
### Buffered Iterator
Useful when your logic can directly process a batch of result instead of one by one
```php
$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
}
```