You are here

public function MediaImage::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/MediaImage.php, line 88

Class

MediaImage
Field Plugin for image field to media image field 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 = [
      'media_generic' => 'media_library_widget',
      'image_image' => 'media_library_widget',
    ];
  }
  return $mapping + parent::getFieldWidgetMap();
}