You are here

private function Importer::resetTypes in Feeds Paragraphs 8

Resets the fields types to the original types.

In order to avoid the created entity having the wrong fields types (e.g 'entity_reference_revisions'), we need to reset them back to the original types

Parameters

FieldTargetDefinition[] $targets: The targets that are being mapped.

1 call to Importer::resetTypes()
Importer::import in src/Importer.php

File

src/Importer.php, line 120

Class

Importer

Namespace

Drupal\feeds_para_mapper

Code

private function resetTypes($targets) {
  foreach ($targets as $target) {
    $field = $target
      ->getFieldDefinition();
    if ($field instanceof FieldConfigInterface && ($info = $field
      ->get('target_info'))) {
      $field
        ->set('field_type', $info->type);
    }
  }
}