You are here

public function TwigPhpStorageCache::getTimestamp in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Template/TwigPhpStorageCache.php \Drupal\Core\Template\TwigPhpStorageCache::getTimestamp()

File

core/lib/Drupal/Core/Template/TwigPhpStorageCache.php, line 121

Class

TwigPhpStorageCache
Provides an alternate cache storage for Twig using PhpStorage.

Namespace

Drupal\Core\Template

Code

public function getTimestamp($key) {
  $cid = 'twig:' . $key;
  if ($cache = $this->cache
    ->get($cid)) {
    return $cache->data;
  }
  else {
    return 0;
  }
}