function entity_test_update_entity_type_alter in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/entity_test_update/entity_test_update.module \entity_test_update_entity_type_alter()
Implements hook_entity_type_alter().
File
- core/
modules/ system/ tests/ modules/ entity_test_update/ entity_test_update.module, line 43 - Provides an entity type for testing definition and schema updates.
Code
function entity_test_update_entity_type_alter(array &$entity_types) {
// Allow entity_test_update tests to override the entity type definition.
$entity_type = \Drupal::state()
->get('entity_test_update.entity_type', $entity_types['entity_test_update']);
if ($entity_type !== 'null') {
$entity_types['entity_test_update'] = $entity_type;
}
else {
unset($entity_types['entity_test_update']);
}
}