protected function doSaveWithLock(AggregateRootInterface $aggregate)
 {
     if (null !== $this->eventStore) {
         $this->eventStore->appendEvents($this->getTypeIdentifier(), $aggregate->getUncommittedEvents());
     }
     parent::doSaveWithLock($aggregate);
 }
 protected function doSaveWithLock(AggregateRootInterface $aggregate)
 {
     $eventStream = $aggregate->getUncommittedEvents();
     $iterator = new \ArrayIterator(array_reverse($this->eventStreamDecorators));
     while ($iterator->valid()) {
         $eventStream = $iterator->current()->decorateForAppend($this->getTypeIdentifier(), $aggregate, $eventStream);
         $iterator->next();
     }
     $this->eventStore->appendEvents($this->getTypeIdentifier(), $eventStream);
 }