You are here

function apdqc_before_entity_info_alter in Asynchronous Prefetch Database Query Cache 7

Implements hook_entity_info_alter().

File

./apdqc.module, line 512
Asynchronous Prefetch Database Query Cache module.

Code

function apdqc_before_entity_info_alter(&$entity_info) {
  $entity_controller_class_info =& drupal_static('apdqc_entity_info_alter');
  foreach ($entity_info as $type => $info) {
    if (isset($info['fieldable'])) {
      $classes = class_implements($info['controller class']);

      // Only use prefetch shim if class only implements
      // DrupalEntityControllerInterface.
      if (count($classes) == 1 && isset($classes['DrupalEntityControllerInterface'])) {
        $entity_controller_class_info[$type] = $info['controller class'];
      }
    }
  }
}