You are here

public function BusinessRulesUtil::getBundles in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/Util/BusinessRulesUtil.php \Drupal\business_rules\Util\BusinessRulesUtil::getBundles()

Return an array with all bundles related to one content type.

Parameters

string $entity_type: The content type ID.

Return value

array Array of bundles.

File

src/Util/BusinessRulesUtil.php, line 460

Class

BusinessRulesUtil
Class BusinessRulesUtil.

Namespace

Drupal\business_rules\Util

Code

public function getBundles($entity_type) {
  $output = [
    '' => $this
      ->t('- Select -'),
  ];
  $bundles = $this->entityTypeBundleInfo
    ->getBundleInfo($entity_type);
  foreach ($bundles as $key => $value) {
    $output[$key] = $value['label'];
  }
  asort($output);
  return $output;
}