You are here

public function EntityExportCsvManager::getBundleFieldDefinitions in Entity Export CSV 8

Get the fields definitions given an entity type and a bundle.

Parameters

string $entity_type_id: The entity type id.

string $bundle: The bundle id.

Return value

array|\Drupal\Core\Field\FieldDefinitionInterface[] An array of field label or field definition, keyed by the field name.

Overrides EntityExportCsvManagerInterface::getBundleFieldDefinitions

1 call to EntityExportCsvManager::getBundleFieldDefinitions()
EntityExportCsvManager::getBundleFields in src/EntityExportCsvManager.php
Get the fields as options given an entity type and a bundle.

File

src/EntityExportCsvManager.php, line 236

Class

EntityExportCsvManager
Class EntityExportCsvManager.

Namespace

Drupal\entity_export_csv

Code

public function getBundleFieldDefinitions($entity_type_id, $bundle) {
  $options = [];
  $fields = $this->entityFieldManager
    ->getFieldDefinitions($entity_type_id, $bundle);
  foreach ($fields as $field_name => $field_definition) {
    $options[$field_name] = $field_definition;
  }
  return $options;
}