X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate%2Fsrc%2FPlugin%2Fmigrate%2Fdestination%2FDestinationBase.php;h=8383e587e564f531e297d25e9bcb029bbab23763;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=18a95e6bfb757f4b6d1f334f9c809b45e45d5bef;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php b/web/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php index 18a95e6bf..8383e587e 100644 --- a/web/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php +++ b/web/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php @@ -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); + } + } + }