Pull merge.
[yaffs-website] / web / core / modules / migrate / src / Plugin / migrate / destination / DestinationBase.php
index 18a95e6bfb757f4b6d1f334f9c809b45e45d5bef..8383e587e564f531e297d25e9bcb029bbab23763 100644 (file)
@@ -12,7 +12,12 @@ use Drupal\migrate\Plugin\RequirementsInterface;
 /**
  * Base class for migrate destination classes.
  *
- * @see \Drupal\migrate\Plugin\MigrateDestinationInterface
+ * Migrate destination plugins perform the import operation of the migration.
+ * Destination plugins extend this abstract base class. A destination plugin
+ * must implement at least fields(), getIds() and import() methods. Destination
+ * plugins can also support rollback operations. For more
+ * information, refer to \Drupal\migrate\Plugin\MigrateDestinationInterface.
+ *
  * @see \Drupal\migrate\Plugin\MigrateDestinationPluginManager
  * @see \Drupal\migrate\Annotation\MigrateDestination
  * @see plugin_api
@@ -110,4 +115,22 @@ abstract class DestinationBase extends PluginBase implements MigrateDestinationI
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDestinationModule() {
+    if (!empty($this->configuration['destination_module'])) {
+      return $this->configuration['destination_module'];
+    }
+    if (!empty($this->pluginDefinition['destination_module'])) {
+      return $this->pluginDefinition['destination_module'];
+    }
+    if (is_string($this->migration->provider)) {
+      return $this->migration->provider;
+    }
+    else {
+      return reset($this->migration->provider);
+    }
+  }
+
 }