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",
* 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;