class SchemaCache

Extends CacheArray to allow for dynamic building of the schema cache.

Hierarchy

Expanded class hierarchy of SchemaCache

1 file declares its use of SchemaCache
schema.inc in drupal/core/includes/schema.inc
Schema API handling functions.

File

drupal/core/lib/Drupal/Core/Utility/SchemaCache.php, line 15
Definition of SchemaCache

Namespace

Drupal\Core\Utility
View source
class SchemaCache extends CacheArray {

  /**
   * Constructs a SchemaCache object.
   */
  public function __construct() {

    // Cache by request method.
    parent::__construct('schema:runtime:' . ($_SERVER['REQUEST_METHOD'] == 'GET'), 'cache', array(
      'schema' => TRUE,
    ));
  }

  /**
   * Implements CacheArray::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

Namesort descending Modifiers Type Description Overrides
CacheArray::$bin protected property A bin to pass to cache()->set() and cache()->get().
CacheArray::$cid protected property A cid to pass to cache()->set() and cache()->get().
CacheArray::$keysToPersist protected property An array of keys to add to the cache at the end of the request.
CacheArray::$storage protected property Storage for the data itself.
CacheArray::$tags protected property A tags array to pass to cache()->set().
CacheArray::clear public function Clear the cache. 1
CacheArray::offsetExists public function Implements ArrayAccess::offsetExists(). 1
CacheArray::offsetGet public function Implements ArrayAccess::offsetGet(). 2
CacheArray::offsetSet public function Implements ArrayAccess::offsetSet().
CacheArray::offsetUnset public function Implements ArrayAccess::offsetUnset().
CacheArray::persist protected function Flags an offset value to be written to the persistent cache.
CacheArray::set protected function Writes a value to the persistent cache immediately. 2
CacheArray::__destruct public function Destructs the CacheArray object. 2
SchemaCache::resolveCacheMiss protected function Implements CacheArray::resolveCacheMiss(). Overrides CacheArray::resolveCacheMiss
SchemaCache::__construct public function Constructs a SchemaCache object. Overrides CacheArray::__construct