TaxonomyTermReference.php 849 Bytes
Newer Older
1 2 3 4
<?php

namespace Drupal\taxonomy\Plugin\migrate\cckfield;

5
use Drupal\migrate\Plugin\MigrationInterface;
6 7 8
use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;

/**
9
 * @MigrateCckField(
10 11 12 13 14
 *   id = "taxonomy_term_reference",
 *   type_map = {
 *     "taxonomy_term_reference" = "entity_reference"
 *   },
 *   core = {6,7}
15
 * )
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
 */
class TaxonomyTermReference extends CckFieldPluginBase {

  /**
   * {@inheritdoc}
   */
  public function getFieldFormatterMap() {
    return array();
  }

  /**
   * {@inheritdoc}
   */
  public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
    $process = array(
      'plugin' => 'iterator',
      'source' => $field_name,
      'process' => array(
        'target_id' => 'tid',
      ),
    );
    $migration->setProcessOfProperty($field_name, $process);
  }

}