function EntityTypeBundleInfo::getBundleInfo

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php \Drupal\Core\Entity\EntityTypeBundleInfo::getBundleInfo()
  2. 10 core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php \Drupal\Core\Entity\EntityTypeBundleInfo::getBundleInfo()
  3. 11.x core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php \Drupal\Core\Entity\EntityTypeBundleInfo::getBundleInfo()

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\Entity

Code

public function getBundleInfo($entity_type_id) {
    $bundle_info = $this->getAllBundleInfo();
    return $bundle_info[$entity_type_id] ?? [];
}

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