LinkField.php 1.07 KB
Newer Older
1 2
<?php

3
namespace Drupal\link\Plugin\migrate\field\d6;
4

5
use Drupal\migrate\Plugin\MigrationInterface;
6
use Drupal\migrate_drupal\Plugin\migrate\field\FieldPluginBase;
7 8

/**
9
 * @MigrateField(
10 11 12
 *   id = "link",
 *   core = {6},
 *   type_map = {
13
 *     "link" = "link",
14 15 16
 *   },
 *   source_module = "link",
 *   destination_module = "link"
17
 * )
18
 */
19
class LinkField extends FieldPluginBase {
20 21 22 23 24

  /**
   * {@inheritdoc}
   */
  public function getFieldFormatterMap() {
25
    // See d6_field_formatter_settings.yml and FieldPluginBase
26
    // alterFieldFormatterMigration().
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
    return [
      'default' => 'link',
      'plain' => 'link',
      'absolute' => 'link',
      'title_plain' => 'link',
      'url' => 'link',
      'short' => 'link',
      'label' => 'link',
      'separate' => 'link_separate',
    ];
  }

  /**
   * {@inheritdoc}
   */
42
  public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
43
    $process = [
44
      'plugin' => 'field_link',
45 46 47
      'source' => $field_name,
    ];
    $migration->mergeProcessOfProperty($field_name, $process);
48 49 50
  }

}