public function CacheArray::__destruct

Destructs the CacheArray object.

2 calls to CacheArray::__destruct()
AliasWhitelist::destruct in drupal/core/lib/Drupal/Core/Path/AliasWhitelist.php
Implements Drupal\Core\DestructableInterface::destruct().
LocaleLookup::destruct in drupal/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
Performs destruct operations.
2 methods override CacheArray::__destruct()
AliasWhitelist::__destruct in drupal/core/lib/Drupal/Core/Path/AliasWhitelist.php
Overrides \Drupal\Core\Utility\CacheArray::clear().
LocaleLookup::__destruct in drupal/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
Destructs the CacheArray object.

File

drupal/core/lib/Drupal/Core/Utility/CacheArray.php, line 226
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);
  }
}