You are here

public function ConditionGroup::getCacheMaxAge in Entity API 8

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 CacheableDependencyTrait::getCacheMaxAge

File

src/QueryAccess/ConditionGroup.php, line 217

Class

ConditionGroup
Represents a group of query access conditions.

Namespace

Drupal\entity\QueryAccess

Code

public function getCacheMaxAge() {
  $max_age = $this->cacheMaxAge;
  foreach ($this->conditions as $condition) {
    if ($condition instanceof ConditionGroup) {
      $max_age = Cache::mergeMaxAges($max_age, $condition
        ->getCacheMaxAge());
    }
  }
  return $max_age;
}