You are here

public function FileEntity::getFieldWidgetMap in Media Migration 8

Get a map between D6 and D8 widgets for this field type.

Return value

array The keys are D6 field widget types and the values D8 widgets.

Overrides FieldPluginBase::getFieldWidgetMap

File

src/Plugin/migrate/field/FileEntity.php, line 101

Class

FileEntity
Field Plugin for file_entity to media migrations.

Namespace

Drupal\media_migration\Plugin\migrate\field

Code

public function getFieldWidgetMap() {
  $mapping = [];
  if ($this->moduleHandler
    ->moduleExists('media_library') && $this->fieldWidgetManager
    ->hasDefinition('media_library_widget')) {
    $mapping = [
      'file_generic' => 'media_library_widget',
      'media_generic' => 'media_library_widget',
    ];
  }
  return $mapping + parent::getFieldWidgetMap();
}