You are here

function entity_entity_info_alter in Entity API 7

Implements hook_entity_info_alter().

See also

entity_module_implements_alter()

File

./entity.module, line 1482

Code

function entity_entity_info_alter(&$entity_info) {
  _entity_info_add_metadata($entity_info);

  // Populate a default value for the 'configuration' key of all entity types.
  foreach ($entity_info as $type => $info) {
    if (!isset($info['configuration'])) {
      $entity_info[$type]['configuration'] = !empty($info['exportable']);
    }
    if (isset($info['controller class']) && in_array('EntityAPIControllerInterface', class_implements($info['controller class']))) {

      // Automatically disable field cache when entity cache is used.
      if (!empty($info['entity cache']) && module_exists('entitycache')) {
        $entity_info[$type]['field cache'] = FALSE;
      }
    }
  }
}