Code Coverage  | 
     ||||||||||
Classes and Traits  | 
      Functions and Methods  | 
      Lines  | 
     ||||||||
| Total |         | 
      0.00%  | 
      0 / 1  | 
              | 
      0.00%  | 
      0 / 4  | 
      CRAP |         | 
      0.00%  | 
      0 / 21  | 
     
| FileField |         | 
      0.00%  | 
      0 / 1  | 
              | 
      0.00%  | 
      0 / 4  | 
      30 |         | 
      0.00%  | 
      0 / 21  | 
     
| getFieldWidgetMap |         | 
      0.00%  | 
      0 / 1  | 
      2 |         | 
      0.00%  | 
      0 / 4  | 
     |||
| getFieldFormatterMap |         | 
      0.00%  | 
      0 / 1  | 
      2 |         | 
      0.00%  | 
      0 / 9  | 
     |||
| processCckFieldValues |         | 
      0.00%  | 
      0 / 1  | 
      2 |         | 
      0.00%  | 
      0 / 6  | 
     |||
| getFieldType |         | 
      0.00%  | 
      0 / 1  | 
      6 |         | 
      0.00%  | 
      0 / 2  | 
     |||
| <?php | |
| /** | |
| * @file | |
| * Contains \Drupal\file\Plugin\migrate\cckfield\d6\FileField. | |
| */ | |
| namespace Drupal\file\Plugin\migrate\cckfield\d6; | |
| use Drupal\migrate\Entity\MigrationInterface; | |
| use Drupal\migrate\Row; | |
| use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase; | |
| /** | |
| * @MigrateCckField( | |
| * id = "filefield" | |
| * ) | |
| */ | |
| class FileField extends CckFieldPluginBase { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getFieldWidgetMap() { | |
| return [ | |
| 'filefield_widget' => 'file_generic', | |
| ]; | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getFieldFormatterMap() { | |
| return [ | |
| 'default' => 'file_default', | |
| 'url_plain' => 'file_url_plain', | |
| 'path_plain' => 'file_url_plain', | |
| 'image_plain' => 'image', | |
| 'image_nodelink' => 'image', | |
| 'image_imagelink' => 'image', | |
| ]; | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) { | |
| $process = [ | |
| 'plugin' => 'd6_cck_file', | |
| 'source' => $field_name, | |
| ]; | |
| $migration->mergeProcessOfProperty($field_name, $process); | |
| } | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function getFieldType(Row $row) { | |
| return $row->getSourceProperty('widget_type') == 'imagefield_widget' ? 'image' : 'file'; | |
| } | |
| } |