function CacheBackendDecorator::delete

Same name and namespace in other branches
  1. 10 core/modules/system/tests/modules/performance_test/src/Cache/CacheBackendDecorator.php \Drupal\performance_test\Cache\CacheBackendDecorator::delete()

Deletes an item from the cache.

If the cache item is being deleted because it is no longer "fresh", you may consider using invalidate() instead. This allows callers to retrieve the invalid item by calling get() with $allow_invalid set to TRUE. In some cases an invalid item may be acceptable rather than having to rebuild the cache.

Parameters

string $cid: The cache ID to delete.

Overrides CacheBackendInterface::delete

File

core/modules/system/tests/modules/performance_test/src/Cache/CacheBackendDecorator.php, line 89

Class

CacheBackendDecorator
Wraps an existing cache backend to track calls to the cache backend.

Namespace

Drupal\performance_test\Cache

Code

public function delete($cid) {
  $start = microtime(TRUE);
  $this->cacheBackend
    ->delete($cid);
  $stop = microtime(TRUE);
  $this->logCacheOperation($cid, $start, $stop, 'delete');
}

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