public function Mapper::loadParentFields in Feeds Paragraphs 8
Loads the parent fields for a nested field
Parameters
$field:
Return value
File
- src/
Mapper.php, line 411
Class
Namespace
Drupal\feeds_para_mapperCode
public function loadParentFields(FieldDefinitionInterface $field) {
$target_info = $field->target_info;
$parents = array();
foreach ($target_info->path as $parentI) {
$bundle = isset($parentI['host_field_bundle']) ? $parentI['host_field_bundle'] : $parentI['bundle'];
$fields = $this->entityFieldManager
->getFieldDefinitions($parentI['host_entity'], $bundle);
$parents[] = $fields[$parentI['host_field']];
}
return $parents;
}