You are here

public function ArrayObject::mergeCacheMaxAge in Express 8

Merges the maximum age (in seconds) with the existing maximum age.

The max age will be set to the given value if it is lower than the existing value.

Parameters

int $max_age: The max age to associate.

Return value

$this

Throws

\InvalidArgumentException Thrown if a non-integer value is supplied.

Overrides RefinableCacheableDependencyInterface::mergeCacheMaxAge

File

themes/contrib/bootstrap/src/Utility/ArrayObject.php, line 276
Contains \Drupal\bootstrap\Utility\ArrayObject.

Class

ArrayObject
Custom ArrayObject implementation.

Namespace

Drupal\bootstrap\Utility

Code

public function mergeCacheMaxAge($max_age) {
  BubbleableMetadata::createFromRenderArray($this->array)
    ->mergeCacheMaxAge($max_age)
    ->applyTo($this->array);
  return $this;
}