You are here

class MigrationConfigDeriver in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/MigrationConfigDeriver.php \Drupal\migrate_plus\Plugin\MigrationConfigDeriver

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

Hierarchy

Expanded class hierarchy of MigrationConfigDeriver

1 string reference to 'MigrationConfigDeriver'
migration_config_deriver.yml in migrations/migration_config_deriver.yml
migrations/migration_config_deriver.yml

File

src/Plugin/MigrationConfigDeriver.php, line 11

Namespace

Drupal\migrate_plus\Plugin
View source
class MigrationConfigDeriver extends DeriverBase {

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
MigrationConfigDeriver::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions