Example #1
0
 /**
  * @param array $parameters
  */
 public function replay($parameters = [])
 {
     $criteria = Criteria::create();
     if (isset($parameters['types'])) {
         $criteria = $criteria->withEventTypes($parameters['types']);
     }
     if (isset($parameters['id'])) {
         $criteria = $criteria->withAggregateRootIds($parameters['id']);
     }
     $visitor = new CallableEventVisitor(function ($event) {
         $this->addEvent($event);
     });
     $this->eventManager->visitEvents($criteria, $visitor);
     $this->publishEvents();
 }
 private function createAndInsertEventFixtures()
 {
     foreach ($this->getEventFixtures() as $domainMessage) {
         $this->eventStore->append($domainMessage->getId(), new DomainEventStream(array($domainMessage)));
     }
 }