function entity_test_bundle_class_entity_type_alter
Same name in other branches
- 9 core/modules/system/tests/modules/entity_test_bundle_class/entity_test_bundle_class.module \entity_test_bundle_class_entity_type_alter()
- 10 core/modules/system/tests/modules/entity_test_bundle_class/entity_test_bundle_class.module \entity_test_bundle_class_entity_type_alter()
Implements hook_entity_type_alter().
File
-
core/
modules/ system/ tests/ modules/ entity_test_bundle_class/ entity_test_bundle_class.module, line 57
Code
function entity_test_bundle_class_entity_type_alter(&$entity_types) {
/** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
if (\Drupal::state()->get('entity_test_bundle_class_override_base_class', FALSE) && isset($entity_types['entity_test'])) {
$entity_types['entity_test']->setClass(EntityTestVariant::class);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.