You are here

public function EntityExportCsvManager::getBundlesEnabledPerEntityType in Entity Export CSV 8

Gets the bundles enabled of an entity type.

Parameters

string $entity_type_id: The entity type id.

bool $return_label: Return an array with label as value.

Return value

array An array of bundles.

Overrides EntityExportCsvManagerInterface::getBundlesEnabledPerEntityType

File

src/EntityExportCsvManager.php, line 224

Class

EntityExportCsvManager
Class EntityExportCsvManager.

Namespace

Drupal\entity_export_csv

Code

public function getBundlesEnabledPerEntityType($entity_type_id, $return_label = FALSE) {
  $options = $this
    ->getBundlesPerEntityType($entity_type_id, $return_label);
  $entity_type_bundle_settings = $this
    ->getConfiguration()
    ->get('entity_types.' . $entity_type_id . '.limit_per_bundle') ?: [];
  if (!empty($entity_type_bundle_settings)) {
    $options = array_intersect_key($options, $entity_type_bundle_settings);
  }
  return $options;
}