Mercurial > hg > cmmr2012-drupal-site
view modules/contrib/migrate_plus/src/Plugin/MigrationConfigDeriver.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
line wrap: on
line source
<?php namespace Drupal\migrate_plus\Plugin; use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\migrate_plus\Entity\Migration; /** * Expose migration entities in the active config store as derivative plugins. */ 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; } }