function config_entity_static_cache_test_config_test_load

Same name in other branches
  1. 8.9.x core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module \config_entity_static_cache_test_config_test_load()
  2. 10 core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module \config_entity_static_cache_test_config_test_load()
  3. 11.x core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module \config_entity_static_cache_test_config_test_load()

Implements hook_ENTITY_TYPE_load() for 'static_cache_test_config_test'.

File

core/modules/config/tests/config_entity_static_cache_test/config_entity_static_cache_test.module, line 13

Code

function config_entity_static_cache_test_config_test_load($entities) {
    static $random;
    if (!$random) {
        $random = new Random();
    }
    foreach ($entities as $entity) {
        // Add a random stamp for every load(), so that during tests, we can tell
        // if an entity was retrieved from cache (unchanged stamp) or reloaded.
        $entity->_loadStamp = $random->string(8, TRUE);
    }
}

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