de8c4f50950e11257692228aa8ba5a79d550ba51
[yaffs-website] / 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  *   source_module = "nodereference",
15  *   destination_module = "core",
16  * )
17  */
18 class NodeReference extends FieldPluginBase {
19
20   /**
21    * {@inheritdoc}
22    */
23   public function defineValueProcessPipeline(MigrationInterface $migration, $field_name, $data) {
24     $process = [
25       'plugin' => 'sub_process',
26       'source' => $field_name,
27       'process' => [
28         'target_id' => [
29           'plugin' => 'get',
30           'source' => 'nid',
31         ],
32       ],
33     ];
34     $migration->setProcessOfProperty($field_name, $process);
35   }
36
37 }