/**
  * {@inheritdoc}
  */
 public function publish(DomainEventInterface $event)
 {
     $eventName = $event->getName();
     if (isset($this->events[$eventName])) {
         foreach ($this->events[$eventName] as $alias) {
             $this->adapter->subscribe($this->serviceLocator->get($alias));
         }
         unset($this->events[$eventName]);
     }
     $this->adapter->publish($event);
     return $this;
 }
 /**
  * {@inheritdoc}
  */
 public function publish(DomainEventInterface $event)
 {
     $this->eventDispatcher->dispatch($event->getName(), new GenericEvent($event));
     return $this;
 }