3 namespace Drupal\file\Plugin\migrate\cckfield\d7;
5 @trigger_error('FileField is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\file\Plugin\migrate\field\d7\FileField instead.', E_USER_DEPRECATED);
7 use Drupal\migrate\Plugin\MigrationInterface;
8 use Drupal\migrate\Row;
9 use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase;
17 * @deprecated in Drupal 8.3.x, to be removed before Drupal 9.0.x. Use
18 * \Drupal\file\Plugin\migrate\field\d7\FileField instead.
20 * @see https://www.drupal.org/node/2751897
22 class FileField extends CckFieldPluginBase {
27 public function getFieldWidgetMap() {
29 'filefield_widget' => 'file_generic',
36 public function getFieldFormatterMap() {
38 'default' => 'file_default',
39 'url_plain' => 'file_url_plain',
40 'path_plain' => 'file_url_plain',
41 'image_plain' => 'image',
42 'image_nodelink' => 'image',
43 'image_imagelink' => 'image',
50 public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
52 'plugin' => 'sub_process',
53 'source' => $field_name,
56 'display' => 'display',
57 'description' => 'description',
60 $migration->mergeProcessOfProperty($field_name, $process);
66 public function getFieldType(Row $row) {
67 return $row->getSourceProperty('widget_type') == 'imagefield_widget' ? 'image' : 'file';