You are here

public function GDPRCollector::getBundles in General Data Protection Regulation 8

Same name and namespace in other branches
  1. 8.2 modules/gdpr_fields/src/GDPRCollector.php \Drupal\gdpr_fields\GDPRCollector::getBundles()
  2. 3.0.x modules/gdpr_fields/src/GDPRCollector.php \Drupal\gdpr_fields\GDPRCollector::getBundles()

Gets bundles belonging to an entity type.

Parameters

string $entity_type_id: The entity type for which bundles should be located.

Return value

array Array of bundles.

File

modules/gdpr_fields/src/GDPRCollector.php, line 176

Class

GDPRCollector
Defines a helper class for stuff related to views data.

Namespace

Drupal\gdpr_fields

Code

public function getBundles($entity_type_id) {
  $all_bundles = $this->bundleInfo
    ->getAllBundleInfo();
  $bundles = isset($all_bundles[$entity_type_id]) ? $all_bundles[$entity_type_id] : [
    $entity_type_id => [],
  ];
  return $bundles;
}