NodeReference.php

Same filename in other branches
  1. 9 core/modules/migrate_drupal/src/Plugin/migrate/field/d6/NodeReference.php
  2. 9 core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php
  3. 9 core/modules/migrate_drupal/src/Plugin/migrate/field/d7/NodeReference.php
  4. 10 core/modules/migrate_drupal/src/Plugin/migrate/field/d6/NodeReference.php
  5. 10 core/modules/migrate_drupal/src/Plugin/migrate/field/d7/NodeReference.php
  6. 11.x core/modules/migrate_drupal/src/Plugin/migrate/field/d6/NodeReference.php
  7. 11.x core/modules/migrate_drupal/src/Plugin/migrate/field/d7/NodeReference.php

Namespace

Drupal\migrate_drupal\Plugin\migrate\field

File

core/modules/migrate_drupal/src/Plugin/migrate/field/NodeReference.php

View source
<?php

namespace Drupal\migrate_drupal\Plugin\migrate\field;

use Drupal\migrate\Plugin\MigrationInterface;

/**
 * @MigrateField(
 *   id = "nodereference",
 *   core = {6},
 *   type_map = {
 *     "nodereference" = "entity_reference",
 *   },
 *   source_module = "nodereference",
 *   destination_module = "core",
 * )
 */
class NodeReference extends FieldPluginBase {
    
    /**
     * {@inheritdoc}
     */
    public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
        $process = [
            'plugin' => 'sub_process',
            'source' => $field_name,
            'process' => [
                'target_id' => [
                    'plugin' => 'get',
                    'source' => 'nid',
                ],
            ],
        ];
        $migration->setProcessOfProperty($field_name, $process);
    }

}

Classes

Title Deprecated Summary
NodeReference Plugin annotation @MigrateField( id = "nodereference", core = {6}, type_map = { "nodereference" = "entity_reference", }, source_module = "nodereference", destination_module = "core", )

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.