TwigPhpStorageCache::getTimestamp

public TwigPhpStorageCache::getTimestamp($key)

Returns the modification timestamp of a key.

Parameters

string $key The cache key:

Return value

int

Overrides Twig_CacheInterface::getTimestamp

File

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

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;
  }
}
doc_Drupal
2016-10-29 09:49:46
Comments
Leave a Comment

Please login to continue.