public function EntityTypeBundleInfo::getBundleInfo in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php \Drupal\Core\Entity\EntityTypeBundleInfo::getBundleInfo()
Gets the bundle info of an entity type.
Parameters
string $entity_type_id: The entity type ID.
Return value
array An array of bundle information where the outer array is keyed by the bundle name, or the entity type name if the entity does not have bundles. The inner arrays are associative arrays of bundle information, such as the label for the bundle.
Overrides EntityTypeBundleInfoInterface::getBundleInfo
File
- core/
lib/ Drupal/ Core/ Entity/ EntityTypeBundleInfo.php, line 79
Class
- EntityTypeBundleInfo
- Provides discovery and retrieval of entity type bundles.
Namespace
Drupal\Core\EntityCode
public function getBundleInfo($entity_type_id) {
$bundle_info = $this
->getAllBundleInfo();
return isset($bundle_info[$entity_type_id]) ? $bundle_info[$entity_type_id] : [];
}