Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / migrate_drupal / src / Plugin / migrate / field / NodeReference.php
1 <?php
2
3 namespace Drupal\migrate_drupal\Plugin\migrate\field;
4
5 use Drupal\migrate\Plugin\MigrationInterface;
6
7 /**
8  * @MigrateField(
9  *   id = "nodereference",
10  *   core = {6},
11  *   type_map = {
12  *     "nodereference" = "entity_reference",
13  *   },
14  * )
15  */
16 class NodeReference extends FieldPluginBase {
17
18   /**
19    * {@inheritdoc}
20    */
21   public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
22     $process = [
23       'plugin' => 'sub_process',
24       'source' => $field_name,
25       'process' => [
26         'target_id' => [
27           'plugin' => 'migration_lookup',
28           'migration' => 'd6_node',
29           'source' => 'nid',
30         ],
31       ],
32     ];
33     $migration->setProcessOfProperty($field_name, $process);
34   }
35
36 }