Commit dbd733e6 authored by benjy's avatar benjy

Fixed event names to use constants.

parent 84a02273
......@@ -13,6 +13,7 @@ use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityManager;
use Drupal\Core\Session\AccountInterface;
use Drupal\default_content\Event\DefaultContentEvents;
use Drupal\default_content\Event\ExportEvent;
use Drupal\default_content\Event\ImportEvent;
use Drupal\rest\LinkManager\LinkManagerInterface;
......@@ -193,7 +194,7 @@ class DefaultContentManager implements DefaultContentManagerInterface {
$created[$entity->uuid()] = $entity;
}
}
$this->eventDispatcher->dispatch('default_content.import', new ImportEvent($created, $module));
$this->eventDispatcher->dispatch(DefaultContentEvents::IMPORT, new ImportEvent($created, $module));
}
// Reset the tree.
$this->resetTree();
......@@ -213,7 +214,7 @@ class DefaultContentManager implements DefaultContentManagerInterface {
$return = $this->serializer->serialize($entity, 'hal_json', ['json_encode_options' => JSON_PRETTY_PRINT]);
// Reset link domain.
$this->linkManager->setLinkDomain(FALSE);
$this->eventDispatcher->dispatch('default_content.import', new ExportEvent($entity));
$this->eventDispatcher->dispatch(DefaultContentEvents::EXPORT, new ExportEvent($entity));
return $return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment