You are here

public function APDQCache::callCacheClearHooks in Asynchronous Prefetch Database Query Cache 7

Allow for 3rd party modules to react to cache clear calls.

Parameters

string $cid: Cache ID.

bool $wildcard: If TRUE then anything after the CID is a match.

1 call to APDQCache::callCacheClearHooks()
APDQCache::clear in ./apdqc.cache.inc
Implements DrupalCacheInterface::clear().

File

./apdqc.cache.inc, line 841
Extends Drupal's default database cache so async queries happen.

Class

APDQCache
A pretty darn quick cache implementation of Drupal's default cache backend.

Code

public function callCacheClearHooks($cid, $wildcard) {
  if (!variable_get('apdqc_call_hook_on_clear', APDQC_CALL_HOOK_ON_CLEAR)) {
    return;
  }
  $apdqc_cache_clear = module_implements('apdqc_cache_clear');
  if (empty($apdqc_cache_clear)) {

    // Bail out if no hooks will be called.
    return;
  }
  $caller = $this
    ->getCaller();

  // Call hook_apdqc_cache_clear().
  module_invoke_all('apdqc_cache_clear', $cid, $wildcard, $this->bin, $caller);
}