condition('migration_group', $this->id()); $names = $query->execute(); // Order the migrations according to their dependencies. /** @var MigrationInterface[] $migrations */ $migrations = \Drupal::entityTypeManager()->getStorage('migration')->loadMultiple($names); // Delete in reverse order, so dependencies are never violated. $migrations = array_reverse($migrations); foreach ($migrations as $migration) { $migration->delete(); } // Finally, delete the group itself. parent::delete(); } /** * {@inheritdoc} */ public function calculateDependencies() { parent::calculateDependencies(); // Make sure we save any explicit module dependencies. if ($provider = $this->get('module')) { $this->addDependency('module', $provider); } return $this->dependencies; } }