You are here

public function FileSystemBackend::invalidate in File Cache 8

Marks a cache item as invalid.

Invalid items may be returned in later calls to get(), if the $allow_invalid argument is TRUE.

Parameters

string $cid: The cache ID to invalidate.

Overrides CacheBackendInterface::invalidate

See also

\Drupal\Core\Cache\CacheBackendInterface::delete()

\Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple()

\Drupal\Core\Cache\CacheBackendInterface::invalidateAll()

1 call to FileSystemBackend::invalidate()
FileSystemBackend::invalidateMultiple in src/Cache/FileSystemBackend.php
Marks cache items as invalid.

File

src/Cache/FileSystemBackend.php, line 199

Class

FileSystemBackend
A cache backend that stores cache items as files on the file system.

Namespace

Drupal\filecache\Cache

Code

public function invalidate($cid) {
  if ($item = $this
    ->get($cid)) {
    $item->expire = $this
      ->getRequestTime() - 1;
    $this
      ->set($cid, $item->data, $item->expire, $item->tags);
  }
}