You are here

protected function MigrationPluginManager::expandPluginIds in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/MigrationPluginManager.php \Drupal\migrate\Plugin\MigrationPluginManager::expandPluginIds()
  2. 10 core/modules/migrate/src/Plugin/MigrationPluginManager.php \Drupal\migrate\Plugin\MigrationPluginManager::expandPluginIds()

Expand derivative migration dependencies.

We need to expand any derivative migrations. Derivative migrations are calculated by migration derivers such as D6NodeDeriver. This allows migrations to depend on the base id and then have a dependency on all derivative migrations. For example, d6_comment depends on d6_node but after we've expanded the dependencies it will depend on d6_node:page, d6_node:story and so on, for other derivative migrations.

Return value

array An array of expanded plugin ids.

1 call to MigrationPluginManager::expandPluginIds()
MigrationPluginManager::createInstances in core/modules/migrate/src/Plugin/MigrationPluginManager.php
Create pre-configured instance of plugin derivatives.

File

core/modules/migrate/src/Plugin/MigrationPluginManager.php, line 145

Class

MigrationPluginManager
Plugin manager for migration plugins.

Namespace

Drupal\migrate\Plugin

Code

protected function expandPluginIds(array $migration_ids) {
  $plugin_ids = [];
  foreach ($migration_ids as $id) {
    $plugin_ids += preg_grep('/^' . preg_quote($id, '/') . PluginBase::DERIVATIVE_SEPARATOR . '/', array_keys($this
      ->getDefinitions()));
    if ($this
      ->hasDefinition($id)) {
      $plugin_ids[] = $id;
    }
  }
  return $plugin_ids;
}