0135444974f3da4f93e587d787563b8977e2c0e6
[yaffs-website] / web / modules / contrib / migrate_plus / src / Plugin / MigrationConfigDeriver.php
1 <?php
2
3 namespace Drupal\migrate_plus\Plugin;
4
5 use Drupal\Component\Plugin\Derivative\DeriverBase;
6 use Drupal\migrate_plus\Entity\Migration;
7
8 /**
9  * Expose migration entities in the active config store as derivative plugins.
10  */
11 class MigrationConfigDeriver extends DeriverBase {
12
13   /**
14    * {@inheritdoc}
15    */
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();
24     }
25     return $this->derivatives;
26   }
27
28 }