function hook_entity_bundle_info_alter
Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_bundle_info_alter()
- 10 core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_bundle_info_alter()
- 11.x core/lib/Drupal/Core/Entity/entity.api.php \hook_entity_bundle_info_alter()
Alter the bundles for entity types.
Parameters
array $bundles: An array of bundles, keyed first by entity type, then by bundle name.
See also
Drupal\Core\Entity\EntityTypeBundleInfo::getBundleInfo()
Related topics
11 functions implement hook_entity_bundle_info_alter()
Note: the procedural functions in this list are found by pattern matching, so the list may include some functions that are not actually implementations of this hook.
- ContentModerationHooks::entityBundleInfoAlter in core/
modules/ content_moderation/ src/ Hook/ ContentModerationHooks.php - Implements hook_entity_bundle_info_alter().
- ContentTranslationHooks::entityBundleInfoAlter in core/
modules/ content_translation/ src/ Hook/ ContentTranslationHooks.php - Implements hook_entity_bundle_info_alter().
- ContentTranslationTestHooks::entityBundleInfoAlter in core/
modules/ content_translation/ tests/ modules/ content_translation_test/ src/ Hook/ ContentTranslationTestHooks.php - Implements hook_entity_bundle_info_alter().
- content_moderation_entity_bundle_info_alter in core/
modules/ content_moderation/ content_moderation.module - Implements hook_entity_bundle_info_alter().
- content_translation_entity_bundle_info_alter in core/
modules/ content_translation/ content_translation.module - Implements hook_entity_bundle_info_alter().
File
-
core/
lib/ Drupal/ Core/ Entity/ entity.api.php, line 908
Code
function hook_entity_bundle_info_alter(&$bundles) {
$bundles['user']['user']['label'] = t('Full account');
// Override the bundle class for the "article" node type in a custom module.
$bundles['node']['article']['class'] = 'Drupal\\mymodule\\Entity\\Article';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.