You are here

public static function EntityExportCsvBatch::getBundleFieldDefinitions in Entity Export CSV 8

File

src/EntityExportCsvBatch.php, line 321

Class

EntityExportCsvBatch
Define entity export csv batch.

Namespace

Drupal\entity_export_csv

Code

public static function getBundleFieldDefinitions($entity_type_id, $bundle) {
  $options = [];

  /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager */
  $entity_field_manager = \Drupal::service('entity_field.manager');
  $fields = $entity_field_manager
    ->getFieldDefinitions($entity_type_id, $bundle);
  foreach ($fields as $field_name => $field_definition) {
    $options[$field_name] = $field_definition;
  }
  return $options;
}