3 namespace Drupal\file\Plugin\migrate\cckfield\d6;
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\d6\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;
15 * source_module = "filefield",
16 * destination_module = "file"
19 * @deprecated in Drupal 8.3.x, to be removed before Drupal 9.0.x. Use
20 * \Drupal\file\Plugin\migrate\field\d6\FileField instead.
22 * @see https://www.drupal.org/node/2751897
24 class FileField extends CckFieldPluginBase {
29 public function getFieldWidgetMap() {
31 'filefield_widget' => 'file_generic',
38 public function getFieldFormatterMap() {
40 'default' => 'file_default',
41 'url_plain' => 'file_url_plain',
42 'path_plain' => 'file_url_plain',
43 'image_plain' => 'image',
44 'image_nodelink' => 'image',
45 'image_imagelink' => 'image',
52 public function processCckFieldValues(MigrationInterface $migration, $field_name, $data) {
54 'plugin' => 'd6_cck_file',
55 'source' => $field_name,
57 $migration->mergeProcessOfProperty($field_name, $process);
63 public function getFieldType(Row $row) {
64 return $row->getSourceProperty('widget_type') == 'imagefield_widget' ? 'image' : 'file';