You are here

public function Mapper::loadParentFields in Feeds Paragraphs 8

Loads the parent fields for a nested field

Parameters

$field:

Return value

FieldDefinitionInterface[]

File

src/Mapper.php, line 411

Class

Mapper

Namespace

Drupal\feeds_para_mapper

Code

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;
}