function MigrateUpgradeImportBatch::onPostImport

Same name in other branches
  1. 9 core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php \Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch::onPostImport()
  2. 8.9.x core/modules/migrate_drupal_ui/src/Batch/MigrateUpgradeImportBatch.php \Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch::onPostImport()
  3. 11.x 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 308

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();
    }
}

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