You are here

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

Same name and namespace in other branches
  1. 8 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 $entityType_id: The entity type for which bundles should be located.

Return value

array Array of bundles.

File

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

Class

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

Namespace

Drupal\gdpr_fields

Code

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