function TwigPhpStorageCache::getTimestamp

Same name in other branches
  1. 9 core/lib/Drupal/Core/Template/TwigPhpStorageCache.php \Drupal\Core\Template\TwigPhpStorageCache::getTimestamp()
  2. 8.9.x core/lib/Drupal/Core/Template/TwigPhpStorageCache.php \Drupal\Core\Template\TwigPhpStorageCache::getTimestamp()
  3. 10 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(string $key) : int {
    $cid = 'twig:' . $key;
    if ($cache = $this->cache
        ->get($cid)) {
        return $cache->data;
    }
    else {
        return 0;
    }
}

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