public function AccessResult::setCacheMaxAge

public AccessResult::setCacheMaxAge($max_age)

Sets the maximum age for which this access result may be cached.

Parameters

int $max_age: The maximum time in seconds that this access result may be cached.

Return value

$this

File

core/lib/Drupal/Core/Access/AccessResult.php, line 224

Class

AccessResult
Value object for passing an access result with cacheability metadata.

Namespace

Drupal\Core\Access

Code

public function setCacheMaxAge($max_age) {
  $this->cacheMaxAge = $max_age;
  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Access!AccessResult.php/function/AccessResult::setCacheMaxAge/8.1.x