You are here

public function Mapper::findParagraphsFields in Feeds Paragraphs 8

Parameters

string $entity_type:

string $bundle:

Return value

FieldDefinitionInterface[]

1 call to Mapper::findParagraphsFields()
Mapper::getTargets in src/Mapper.php

File

src/Mapper.php, line 80

Class

Mapper

Namespace

Drupal\feeds_para_mapper

Code

public function findParagraphsFields($entity_type, $bundle) {
  $fields = array();
  $entityFields = $this->entityFieldManager
    ->getFieldDefinitions($entity_type, $bundle);
  if (!isset($entityFields)) {
    return $fields;
  }
  $entityFields = array_filter($entityFields, function ($item) {
    return $item instanceof FieldConfigInterface;
  });
  foreach ($entityFields as $field) {
    if ($field
      ->getType() === 'entity_reference_revisions') {
      $fields[] = $field;
    }
  }
  return $fields;
}