public function CacheArray::__destruct

Destructs the CacheArray object.

File

drupal/core/lib/Drupal/Core/Utility/CacheArray.php, line 217
Definition of CacheArray

Class

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

Namespace

Drupal\Core\Utility

Code

public function __destruct() {
  $data = array();
  foreach ($this->keysToPersist as $offset => $persist) {
    if ($persist) {
      $data[$offset] = $this->storage[$offset];
    }
  }
  if (!empty($data)) {
    $this
      ->set($data);
  }
}