3 namespace Drupal\migrate_plus\Plugin;
5 use Drupal\Component\Plugin\Derivative\DeriverBase;
6 use Drupal\migrate_plus\Entity\Migration;
9 * Expose migration entities in the active config store as derivative plugins.
11 class MigrationConfigDeriver extends DeriverBase {
16 public function getDerivativeDefinitions($base_plugin_definition) {
17 // Always rederive from scratch, because changes may have been made without
18 // clearing our internal cache.
19 $this->derivatives = [];
20 $migrations = Migration::loadMultiple();
21 /** @var \Drupal\migrate_plus\Entity\MigrationInterface $migration */
22 foreach ($migrations as $id => $migration) {
23 $this->derivatives[$id] = $migration->toArray();
25 return $this->derivatives;