Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / migrate_drupal / src / Plugin / migrate / field / UserReference.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 = "userreference",
10  *   core = {6},
11  *   type_map = {
12  *     "userreference" = "entity_reference",
13  *   },
14  * )
15  */
16 class UserReference extends FieldPluginBase {
17
18   /**
19    * {@inheritdoc}
20    */
21   public function getFieldFormatterMap() {
22     return [];
23   }
24
25   /**
26    * {@inheritdoc}
27    */
28   public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
29     $process = [
30       'plugin' => 'iterator',
31       'source' => $field_name,
32       'process' => [
33         'target_id' => [
34           'plugin' => 'migration_lookup',
35           'migration' => 'd6_user',
36           'source' => 'uid',
37         ],
38       ],
39     ];
40     $migration->setProcessOfProperty($field_name, $process);
41   }
42
43 }