You are here

public function MigrationConfigDeriver::getDerivativeDefinitions in Migrate Plus 8.5

Same name and namespace in other branches
  1. 8.4 src/Plugin/MigrationConfigDeriver.php \Drupal\migrate_plus\Plugin\MigrationConfigDeriver::getDerivativeDefinitions()

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

src/Plugin/MigrationConfigDeriver.php, line 16

Class

MigrationConfigDeriver
Expose migration entities in the active config store as derivative plugins.

Namespace

Drupal\migrate_plus\Plugin

Code

public function getDerivativeDefinitions($base_plugin_definition) {

  // Always rederive from scratch, because changes may have been made without
  // clearing our internal cache.
  $this->derivatives = [];
  $migrations = Migration::loadMultiple();

  /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */
  foreach ($migrations as $id => $migration) {
    if (!$migration
      ->status()) {
      continue;
    }
    $this->derivatives[$id] = $migration
      ->toArray();
  }
  return $this->derivatives;
}