1 entity_caching_test.module entity_caching_test_entity_info_alter(&$entity_info)

Implements hook_entity_info_alter().

File

core/modules/entity/tests/entity_caching_test/entity_caching_test.module, line 58
Test module for the entity API providing an entity type for testing.

Code

function entity_caching_test_entity_info_alter(&$entity_info) {
  // Enable caching on the 'test_disable_cache' entity at the entity level.
  $entity_info['test_cacheable']['entity cache'] = TRUE;

  // Disable caching on the 'test_disable_cache' entity at the entity level.
  $entity_info['test_disable_cache']['entity cache'] = FALSE;

  // Enable caching on the 'test_multibundle' entity at the entity level, but
  // disable caching on one of the bundles  at the bundle level.
  $entity_info['test_multibundle']['entity cache'] = TRUE;
  $entity_info['test_multibundle']['bundles']['nocache']['bundle cache'] = FALSE;
}