You are here

public function MigrateHelper::rollback in Panopoly Core 8.2

Rolls back the given migrations in reverse order.

Parameters

array $migration_ids: List of migration ids to rollback.

File

src/MigrateHelper.php, line 85

Class

MigrateHelper
Service with some helper functions for working with migrate.

Namespace

Drupal\panopoly_core

Code

public function rollback(array $migration_ids) {

  // Do the migrations in reverse (half-ass dependency checking).
  $migration_ids = array_reverse($migration_ids);
  $migrations = $this->migrationManager
    ->createInstances($migration_ids);
  foreach ($migrations as $migration) {
    $executable = $this
      ->createExecutable($migration);
    $executable
      ->rollback();
  }
}