Skip to content

Commit

Permalink
pull events from initialized Doctrine proxy classes
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gribanov committed Oct 19, 2018
1 parent 377dec3 commit 99e6970
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Service/EventPuller.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ private function pullFromEntities(array $entities)
{
$events = [];
foreach ($entities as $entity) {
// ignore Doctrine proxy classes
// ignore Doctrine not initialized proxy classes
// proxy class can't have a domain events
if (!($entity instanceof Proxy) && $entity instanceof AggregateEvents) {
if ((!($entity instanceof Proxy) || $entity->__isInitialized()) && $entity instanceof AggregateEvents) {
$events = array_merge($events, $entity->pullEvents());
}
}
Expand Down

0 comments on commit 99e6970

Please sign in to comment.