Version 1
[yaffs-website] / web / core / modules / file / src / Plugin / migrate / cckfield / d7 / ImageField.php
1 <?php
2
3 namespace Drupal\file\Plugin\migrate\cckfield\d7;
4
5 use Drupal\migrate\Plugin\MigrationInterface;
6 use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
7
8 /**
9  * @MigrateCckField(
10  *   id = "image",
11  *   core = {7}
12  * )
13  */
14 class ImageField extends CckFieldPluginBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public function getFieldFormatterMap() {
20     return [];
21   }
22
23   /**
24    * {@inheritdoc}
25    */
26   public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
27     $process = [
28       'plugin' => 'iterator',
29       'source' => $field_name,
30       'process' => [
31         'target_id' => 'fid',
32         'alt' => 'alt',
33         'title' => 'title',
34         'width' => 'width',
35         'height' => 'height',
36       ],
37     ];
38     $migration->mergeProcessOfProperty($field_name, $process);
39   }
40
41 }