public function CachedStorage::write

Implements Drupal\Core\Config\StorageInterface::write().

Overrides StorageInterface::write

File

drupal/core/lib/Drupal/Core/Config/CachedStorage.php, line 85
Contains Drupal\Core\Config\CachedStorage.

Class

CachedStorage
Defines the cached storage controller.

Namespace

Drupal\Core\Config

Code

public function write($name, array $data) {
  if ($this->storage
    ->write($name, $data)) {

    // While not all written data is read back, setting the cache instead of
    // just deleting it avoids cache rebuild stampedes.
    $this->cache
      ->set($name, $data, CacheBackendInterface::CACHE_PERMANENT);
    return TRUE;
  }
  return FALSE;
}