You are here

protected function EntityProcessorBase::onEntityImported in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Processors/Entity/EntityProcessorBase.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorBase::onEntityImported()
  2. 3.x src/Processors/Entity/EntityProcessorBase.php \Drupal\content_synchronizer\Processors\Entity\EntityProcessorBase::onEntityImported()

Callback when the entity has been imported.

1 call to EntityProcessorBase::onEntityImported()
EntityProcessorBase::import in src/Processors/Entity/EntityProcessorBase.php
Create or update entity with data :.

File

src/Processors/Entity/EntityProcessorBase.php, line 338

Class

EntityProcessorBase
The entity processor base.

Namespace

Drupal\content_synchronizer\Processors\Entity

Code

protected function onEntityImported($gid, Entity $entity) {

  /** @var \Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $dispatcher */
  $dispatcher = \Drupal::service('event_dispatcher');
  $event = new ImportEvent();
  $event
    ->setEntity($entity);
  $event
    ->setGid($gid);
  $dispatcher
    ->dispatch(ImportEvent::ON_ENTITY_IMPORTER, $event);
}