X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate%2Fsrc%2FPlugin%2Fmigrate%2Fdestination%2FEntity.php;fp=web%2Fcore%2Fmodules%2Fmigrate%2Fsrc%2FPlugin%2Fmigrate%2Fdestination%2FEntity.php;h=0cebbd07c82432446afbd02e507e019b498828fc;hp=ae6d6e9bad2f809b45e6d701a8a05d9820a7d3d8;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/modules/migrate/src/Plugin/migrate/destination/Entity.php b/web/core/modules/migrate/src/Plugin/migrate/destination/Entity.php index ae6d6e9ba..0cebbd07c 100644 --- a/web/core/modules/migrate/src/Plugin/migrate/destination/Entity.php +++ b/web/core/modules/migrate/src/Plugin/migrate/destination/Entity.php @@ -11,7 +11,48 @@ use Drupal\migrate\Row; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Provides entity destination plugin. + * Provides a generic destination to import entities. + * + * Available configuration keys: + * - translations: (optional) Boolean, if TRUE, the destination will be + * associated with the langcode provided by the source plugin. Defaults to + * FALSE. + * + * Examples: + * + * @code + * source: + * plugin: d7_node + * process: + * nid: tnid + * vid: vid + * langcode: language + * title: title + * ... + * revision_timestamp: timestamp + * destination: + * plugin: entity:node + * @endcode + * + * This will save the processed, migrated row as a node. + * + * @code + * source: + * plugin: d7_node + * process: + * nid: tnid + * vid: vid + * langcode: language + * title: title + * ... + * revision_timestamp: timestamp + * destination: + * plugin: entity:node + * translations: true + * @endcode + * + * This will save the processed, migrated row as a node with the relevant + * langcode because the translations configuration is set to "true". * * @MigrateDestination( * id = "entity", @@ -53,6 +94,10 @@ abstract class Entity extends DestinationBase implements ContainerFactoryPluginI * The list of bundles this entity type has. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EntityStorageInterface $storage, array $bundles) { + $plugin_definition += [ + 'label' => $storage->getEntityType()->getPluralLabel(), + ]; + parent::__construct($configuration, $plugin_id, $plugin_definition, $migration); $this->storage = $storage; $this->bundles = $bundles;