function EntityTypeBundleInfo::getBundleLabels

Gets an array of bundle labels for an entity type.

Parameters

string $entity_type_id: The entity type ID.

Return value

array An array of bundle labels, keyed by bundle id.

Overrides EntityTypeBundleInfoInterface::getBundleLabels

File

core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php, line 91

Class

EntityTypeBundleInfo
Provides discovery and retrieval of entity type bundles.

Namespace

Drupal\Core\Entity

Code

public function getBundleLabels(string $entity_type_id) : array {
  return array_map(static fn(array $bundle_info) => $bundle_info['label'], $this->getBundleInfo($entity_type_id));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.