You are here

public static function MigrateUpgradeImportBatch::onPostImport in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php \Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch::onPostImport()

Adds follow-up migrations.

Parameters

\Drupal\migrate\Event\MigrateImportEvent $event: The import event.

File

core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php, line 300

Class

MigrateUpgradeImportBatch
Runs a single migration batch.

Namespace

Drupal\migrate_drupal_ui\Batch

Code

public static function onPostImport(MigrateImportEvent $event) {
  $migration = $event
    ->getMigration();
  if ($migration instanceof MigrationWithFollowUpInterface) {

    // After the migration on which they depend has been successfully
    // executed, the follow-up migrations are immediately added to the batch
    // and removed from the $followUpMigrations property. This means that the
    // $followUpMigrations property is always empty at this point and it's OK
    // to override it with the next follow-up migrations.
    static::$followUpMigrations = $migration
      ->generateFollowUpMigrations();
  }
}