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
Namespace
Drupal\feeds_para_mapperCode
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);
}
}
}