symfony-bundles / patterns
SymfonyBundles Patterns Library
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 4 273
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.1
Requires (Dev)
- phpunit/php-code-coverage: ^5.0|^7.0
- phpunit/phpunit: ^6.4|^8.0
This package is auto-updated.
Last update: 2020-11-17 23:42:38 UTC
README
Installation
Require the bundle with composer:
composer require symfony-bundles/patterns
Batch Processing Pattern
Calls listeners when the size of the package reaches the desired size.
Example
$collection = (new \MongoDB\Client())->test->users; $batchProcessing = new BatchProcessing(100, $collection->find()); $batchProcessing->addListener(function(array $elements) { // do something with the elements of the package }); $batchProcessing->process();