class SchemaCache
Extends DrupalCacheArray to allow for dynamic building of the schema cache.
Hierarchy
- class \DrupalCacheArray implements \ArrayAccess
- class \SchemaCache
Expanded class hierarchy of SchemaCache
Related topics
File
- drupal-7.x/
includes/ bootstrap.inc, line 2964 - Functions that need to be loaded on every Drupal request.
View source
class SchemaCache extends DrupalCacheArray {
/**
* Constructs a SchemaCache object.
*/
public function __construct() {
// Cache by request method.
parent::__construct('schema:runtime:' . ($_SERVER['REQUEST_METHOD'] == 'GET'), 'cache');
}
/**
* Overrides DrupalCacheArray::resolveCacheMiss().
*/
protected function resolveCacheMiss($offset) {
$complete_schema = drupal_get_complete_schema();
$value = isset($complete_schema[$offset]) ? $complete_schema[$offset] : NULL;
$this->storage[$offset] = $value;
$this->persist($offset);
return $value;
}
}
Members
Name | Modifiers | Type | Description |
---|---|---|---|
DrupalCacheArray:: |
protected | property | A bin to pass to cache_set() and cache_get(). |
DrupalCacheArray:: |
protected | property | A cid to pass to cache_set() and cache_get(). |
DrupalCacheArray:: |
protected | property | An array of keys to add to the cache at the end of the request. |
DrupalCacheArray:: |
protected | property | Storage for the data itself. |
DrupalCacheArray:: |
public | function | Implements ArrayAccess::offsetExists(). |
DrupalCacheArray:: |
public | function | Implements ArrayAccess::offsetGet(). |
DrupalCacheArray:: |
public | function | Implements ArrayAccess::offsetSet(). |
DrupalCacheArray:: |
public | function | Implements ArrayAccess::offsetUnset(). |
DrupalCacheArray:: |
protected | function | Flags an offset value to be written to the persistent cache. |
DrupalCacheArray:: |
protected | function | Writes a value to the persistent cache immediately. |
DrupalCacheArray:: |
public | function | Destructs the DrupalCacheArray object. |
SchemaCache:: |
protected | function |
Overrides DrupalCacheArray::resolveCacheMiss(). Overrides DrupalCacheArray:: |
SchemaCache:: |
public | function |
Constructs a SchemaCache object. Overrides DrupalCacheArray:: |