function CachePluginBase::getCacheMaxAge

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getCacheMaxAge()
  2. 10 core/modules/views/src/Plugin/views/cache/CachePluginBase.php \Drupal\views\Plugin\views\cache\CachePluginBase::getCacheMaxAge()
  3. 11.x 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 260

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.