Version 1
[yaffs-website] / web / core / modules / link / src / Plugin / migrate / field / d6 / LinkField.php
diff --git a/web/core/modules/link/src/Plugin/migrate/field/d6/LinkField.php b/web/core/modules/link/src/Plugin/migrate/field/d6/LinkField.php
new file mode 100644 (file)
index 0000000..0d03656
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+namespace Drupal\link\Plugin\migrate\field\d6;
+
+use Drupal\migrate\Plugin\MigrationInterface;
+use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
+
+/**
+ * @MigrateField(
+ *   id = "link",
+ *   core = {6},
+ *   type_map = {
+ *     "link_field" = "link"
+ *   }
+ * )
+ */
+class LinkField extends FieldPluginBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFieldFormatterMap() {
+    // See d6_field_formatter_settings.yml and FieldPluginBase
+    // processFieldFormatter().
+    return [
+      'default' => 'link',
+      'plain' => 'link',
+      'absolute' => 'link',
+      'title_plain' => 'link',
+      'url' => 'link',
+      'short' => 'link',
+      'label' => 'link',
+      'separate' => 'link_separate',
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+    $process = [
+      'plugin' => 'd6_field_link',
+      'source' => $field_name,
+    ];
+    $migration->mergeProcessOfProperty($field_name, $process);
+  }
+
+}