function MigrateExecutable::getEventDispatcher

Same name in other branches
  1. 9 core/modules/migrate/src/MigrateExecutable.php \Drupal\migrate\MigrateExecutable::getEventDispatcher()
  2. 10 core/modules/migrate/src/MigrateExecutable.php \Drupal\migrate\MigrateExecutable::getEventDispatcher()
  3. 11.x core/modules/migrate/src/MigrateExecutable.php \Drupal\migrate\MigrateExecutable::getEventDispatcher()

Gets the event dispatcher.

Return value

\Symfony\Component\EventDispatcher\EventDispatcherInterface

File

core/modules/migrate/src/MigrateExecutable.php, line 140

Class

MigrateExecutable
Defines a migrate executable class.

Namespace

Drupal\migrate

Code

protected function getEventDispatcher() {
    if (!$this->eventDispatcher) {
        $this->eventDispatcher = \Drupal::service('event_dispatcher');
    }
    return $this->eventDispatcher;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.