You are here

public function Sql::getCacheMaxAge in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::getCacheMaxAge()

The maximum age for which this object may be cached.

Return value

int The maximum time in seconds that this object may be cached.

Overrides QueryPluginBase::getCacheMaxAge

File

core/modules/views/src/Plugin/views/query/Sql.php, line 1692

Class

Sql
Views query plugin for an SQL query.

Namespace

Drupal\views\Plugin\views\query

Code

public function getCacheMaxAge() {
  $max_age = parent::getCacheMaxAge();
  foreach ($this
    ->getAllEntities() as $entity) {
    $max_age = Cache::mergeMaxAges($max_age, $entity
      ->getCacheMaxAge());
  }
  return $max_age;
}