Skip to content

Commit

Permalink
onBeforeLoadNewData
Browse files Browse the repository at this point in the history
  • Loading branch information
michallohnisky authored Apr 17, 2018
1 parent 51e1521 commit 34343a7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ via composer:
composer require adt/bulk-fetcher
```

## Usage
## Full example

foreach (new \ADT\BulkFetcher($resultSet, 100) as $key => $value) {
```php
$bulkedResultSet = new \ADT\BulkFetcher($resultSet, 100);
$bulkedResultSet->onBeforeLoadNewData[] = function() use ($entityManager) {
$entityManager->clear();
};

foreach ($bulkedResultSet as $key => $row) {
// code
}
}
```

0 comments on commit 34343a7

Please sign in to comment.