function DrupalCacheArray::__destruct

Destructs the DrupalCacheArray object.

File

includes/bootstrap.inc, line 456

Class

DrupalCacheArray
Provides a caching wrapper to be used in place of large array structures.

Code

public function __destruct() {
    if ($this->bin == 'cache_form' && !variable_get('drupal_cache_array_persist_cache_form', FALSE)) {
        return;
    }
    $data = array();
    foreach ($this->keysToPersist as $offset => $persist) {
        if ($persist) {
            $data[$offset] = $this->storage[$offset];
        }
    }
    if (!empty($data)) {
        $this->set($data);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.