Browse Source

Removed the need for specific per-entity sources: just use reinstall_base source plugin in migrations.

Frederic G. MARAND 7 years ago
parent
commit
4d5cddeae4

+ 1 - 1
src/EventSubscriber/UserPreImport.php

@@ -15,7 +15,7 @@ class UserPreImport implements EventSubscriberInterface {
   }
 
   public function onPreImport(MigrateImportEvent $event) {
-    /** @var \Drupal\reinstall\Plugin\migrate\source\ReinstallUserSource $plugin */
+    /** @var \Drupal\reinstall\Plugin\migrate\source\ReinstallUserSourceBase $plugin */
     $plugin = $event->getMigration()->getSourcePlugin();
     $plugin->records = array_filter($plugin->records, [$this, 'filter01']);
     return;

+ 0 - 14
src/Plugin/migrate/source/ReinstallFileSource.php

@@ -1,14 +0,0 @@
-<?php
-
-namespace Drupal\reinstall\Plugin\migrate\source;
-
-/**
- * Source plugin for files from a YAML file.
- *
- * @MigrateSource(
- *   id = "reinstall_files"
- * )
- */
-class ReinstallFileSource extends SimpleSource {
-
-}

+ 0 - 14
src/Plugin/migrate/source/ReinstallNodeSource.php

@@ -1,14 +0,0 @@
-<?php
-
-namespace Drupal\reinstall\Plugin\migrate\source;
-
-/**
- * Source plugin for nodes from a YAML file.
- *
- * @MigrateSource(
- *   id = "reinstall_node"
- * )
- */
-class ReinstallNodeSource extends SimpleSource {
-
-}

+ 0 - 14
src/Plugin/migrate/source/ReinstallParagraphSource.php

@@ -1,14 +0,0 @@
-<?php
-
-namespace Drupal\reinstall\Plugin\migrate\source;
-
-/**
- * Source plugin for terms from a YAML file.
- *
- * @MigrateSource(
- *   id = "reinstall_paragraphs"
- * )
- */
-class ReinstallParagraphSource extends SimpleSource {
-
-}

+ 5 - 1
src/Plugin/migrate/source/SimpleSource.php → src/Plugin/migrate/source/ReinstallSourceBase.php

@@ -15,8 +15,12 @@ use Symfony\Component\Yaml\Yaml;
 
 /**
  * Class SimpleSource provides the basic mechanisms to load a YML entity dump.
+ *
+ * @MigrateSource(
+ *   id = "reinstall_base"
+ * )
  */
-abstract class SimpleSource extends SourcePluginBase implements ContainerFactoryPluginInterface {
+class ReinstallSourceBase extends SourcePluginBase implements ContainerFactoryPluginInterface {
   use SimpleSourceTrait;
 
   /**

+ 0 - 17
src/Plugin/migrate/source/ReinstallTermSource.php

@@ -1,17 +0,0 @@
-<?php
-
-namespace Drupal\reinstall\Plugin\migrate\source;
-
-use Drupal\migrate\Plugin\MigrationInterface;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-
-/**
- * Source plugin for terms from a YAML file.
- *
- * @MigrateSource(
- *   id = "reinstall_terms"
- * )
- */
-class ReinstallTermSource extends SimpleSource {
-
-}

+ 0 - 14
src/Plugin/migrate/source/ReinstallUserSource.php

@@ -1,14 +0,0 @@
-<?php
-
-namespace Drupal\reinstall\Plugin\migrate\source;
-
-/**
- * Source plugin for users from a YAML file.
- *
- * @MigrateSource(
- *   id = "reinstall_users"
- * )
- */
-class ReinstallUserSource extends SimpleSource {
-
-}

+ 0 - 6
src/Plugin/migrate/source/SimpleSourceTrait.php

@@ -1,10 +1,4 @@
 <?php
-/**
- * Created by PhpStorm.
- * User: fgm
- * Date: 11/04/2017
- * Time: 08:35
- */
 
 namespace Drupal\reinstall\Plugin\migrate\source;