function CachePluginBase::getCacheMaxAge

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getCacheMaxAge()
  2. 8.9.x core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getCacheMaxAge()
  3. 10 core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getCacheMaxAge()

Gets the max age for the current view.

Return value

int

File

core/modules/views/src/Plugin/views/cache/CachePluginBase.php, line 262

Class

CachePluginBase
The base plugin to handle caching.

Namespace

Drupal\views\Plugin\views\cache

Code

public function getCacheMaxAge() {
    $max_age = $this->getDefaultCacheMaxAge();
    $max_age = Cache::mergeMaxAges($max_age, $this->view
        ->getQuery()
        ->getCacheMaxAge());
    return $max_age;
}

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