You are here

public function MigrateExecutable::onPostRollback in Migrate Tools 8.5

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

React to rollback completion.

Parameters

\Drupal\migrate\Event\MigrateRollbackEvent $event: The map event.

File

src/MigrateExecutable.php, line 295

Class

MigrateExecutable
Defines a migrate executable class for drush.

Namespace

Drupal\migrate_tools

Code

public function onPostRollback(MigrateRollbackEvent $event) {
  $migrate_last_imported_store = \Drupal::keyValue('migrate_last_imported');
  $migrate_last_imported_store
    ->set($event
    ->getMigration()
    ->id(), FALSE);
  $this
    ->rollbackMessage();

  // If this is a sync import, then don't remove listeners or post import will
  // not be executed. Leave it to post import to remove listeners.
  if (empty($event
    ->getMigration()->syncSource)) {
    $this
      ->removeListeners();
  }
}