Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_load()
  2. 9 core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_load()

Act on entities of a specific type when loaded.

Parameters

array $entities: The entities keyed by entity ID.

See also

hook_entity_load()

Related topics

29 functions implement hook_ENTITY_TYPE_load()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

book_node_load in core/modules/book/book.module
Implements hook_ENTITY_TYPE_load() for node entities.
comment_entity_storage_load in core/modules/comment/comment.module
Implements hook_entity_storage_load().
config_entity_static_cache_test_config_test_load in core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module
Implements hook_ENTITY_TYPE_load() for 'static_cache_test_config_test'.
config_test_config_test_load in core/modules/config/tests/config_test/config_test.hooks.inc
Implements hook_config_test_load().
entity_crud_hook_test_block_load in core/modules/system/tests/modules/entity_crud_hook_test/entity_crud_hook_test.module
Implements hook_ENTITY_TYPE_load() for block entities.

... See full list

File

core/lib/Drupal/Core/Entity/entity.api.php, line 1047
Hooks and documentation related to entities.

Code

function hook_ENTITY_TYPE_load($entities) {
  foreach ($entities as $entity) {
    $entity->foo = mymodule_add_something($entity);
  }
}