You are here

protected function MigrateExecutable::removeListeners in Migrate Tools 8.5

Same name and namespace in other branches
  1. 8 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::removeListeners()
  2. 8.2 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::removeListeners()
  3. 8.3 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::removeListeners()
  4. 8.4 src/MigrateExecutable.php \Drupal\migrate_tools\MigrateExecutable::removeListeners()

Clean up all our event listeners.

2 calls to MigrateExecutable::removeListeners()
MigrateExecutable::onPostImport in src/MigrateExecutable.php
React to migration completion.
MigrateExecutable::onPostRollback in src/MigrateExecutable.php
React to rollback completion.

File

src/MigrateExecutable.php, line 248

Class

MigrateExecutable
Defines a migrate executable class for drush.

Namespace

Drupal\migrate_tools

Code

protected function removeListeners() {
  foreach ($this->listeners as $event => $listener) {

    // Don't remove the listener for the events that are currently being
    // dispatched.
    if ($event !== MigrateEvents::POST_IMPORT && $event !== MigrateEvents::POST_ROLLBACK) {
      $this
        ->getEventDispatcher()
        ->removeListener($event, $listener);
    }
  }
}