You are here

protected function CacheObjectAPIWrapper::getDelegateClass in Cache Object API 7

Return the name of the delegate class for the current bin.

First try to determine the delegate class by reading the following settings in this exact order: 1. $conf['cacheobject_class_BIN'] // where BIN is the cache bin for this object. E.g. cacheobject_class_cache_form. 2. $conf['cacheobject_default_class'] 3. $conf['cache_default_class']

If none of these settings contain a class name, DrupalDatabaseCache is returned.

Return value

string The name of the class to be used as the delegate cache class.

1 call to CacheObjectAPIWrapper::getDelegateClass()
CacheObjectAPIWrapper::__construct in ./cacheobject.inc
Constructs a new cache interface.

File

./cacheobject.inc, line 183
Provides Cache Object API wrapper class.

Class

CacheObjectAPIWrapper
Provides a cache class exposing hooks operating on objects before they are stored to and after they were received from the cache.

Code

protected function getDelegateClass() {
  $class = variable_get('cacheobject_class_' . $this->bin);
  if (isset($class) && $class != 'CacheObjectAPIWrapper') {
    return $class;
  }
  $class = variable_get('cacheobject_default_class');
  if (isset($class) && $class != 'CacheObjectAPIWrapper') {
    return $class;
  }
  $class = variable_get('cache_default_class');
  if (isset($class) && $class != 'CacheObjectAPIWrapper') {
    return $class;
  }
  return 'DrupalDatabaseCache';
}