Skip to content

Instantly share code, notes, and snippets.

@mikemix
Last active November 2, 2016 14:33
Show Gist options
  • Save mikemix/5ebb1726c42aeea633eca1feec1120e3 to your computer and use it in GitHub Desktop.
Save mikemix/5ebb1726c42aeea633eca1feec1120e3 to your computer and use it in GitHub Desktop.
<?php
$this->eventStore->beginTransaction();
foreach ($data as $domain => $records) {
$aggregate = Domain::create(Uuid::uuid4(), new DomainId($domain));
foreach ($records as $record) {
try {
$aggregate->addRecord(...);
} catch (DomainException $e) {
$this->console->writeLine($e->getMessage());
}
$this->repository->add($aggregate);
}
}
$this->eventStore->commit();
```
Fatal error: Maximum function nesting level of '256' reached, aborting! in /var/www/html/vendor/prooph/event-store/src/EventStore.php on line 151
Call Stack:
0.0002 354584 1. {main}() /var/www/html/public/index.php:0
0.0801 7619024 2. Zend\Mvc\Application->run() /var/www/html/public/index.php:15
0.0802 7620616 3. Zend\EventManager\EventManager->triggerEventUntil() /var/www/html/vendor/zendframework/zend-mvc/src/Application.php:340
0.0802 7620616 4. Zend\EventManager\EventManager->triggerListeners() /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:263
0.0803 7622344 5. call_user_func:{/var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:490}() /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:490
0.0803 7622344 6. Zend\Mvc\DispatchListener->onDispatch() /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:490
0.0970 9259888 7. Zend\Mvc\Controller\AbstractConsoleController->dispatch() /var/www/html/vendor/zendframework/zend-mvc/src/DispatchListener.php:118
0.0970 9259888 8. Zend\Mvc\Controller\AbstractController->dispatch() /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractConsoleController.php:55
0.0970 9260208 9. Zend\EventManager\EventManager->triggerEventUntil() /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php:118
0.0970 9260208 10. Zend\EventManager\EventManager->triggerListeners() /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:263
0.0972 9271064 11. call_user_func:{/var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:490}() /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:490
0.0972 9271064 12. Zend\Mvc\Controller\AbstractActionController->onDispatch() /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php:490
0.0972 9271104 13. App\Console\Controller\EventStoreController->importAction() /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php:82
0.8357 17109632 14. App\Entity\Repository\DomainRepository->add() /var/www/html/module/Console/src/Controller/EventStoreController.php:71
0.8357 17109632 15. Prooph\EventStore\Aggregate\AggregateRepository->addAggregateRoot() /var/www/html/module/App/src/Entity/Repository/DomainRepository.php:33
0.8359 17113832 16. Prooph\EventStore\EventStore->appendTo() /var/www/html/vendor/prooph/event-store/src/Aggregate/AggregateRepository.php:142
0.8364 17118576 17. AppendIterator->append() /var/www/html/vendor/prooph/event-store/src/EventStore.php:151
0.8364 17119040 18. AppendIterator->rewind() /var/www/html/vendor/prooph/event-store/src/EventStore.php:151
// last line is repeated until the script aborts
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment