Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/modules/entity_test/src/TypedData/ComputedString.php \Drupal\entity_test\TypedData\ComputedString::getCacheMaxAge()
  2. 9 core/modules/system/tests/modules/entity_test/src/TypedData/ComputedString.php \Drupal\entity_test\TypedData\ComputedString::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. An object may be cached permanently by returning \Drupal\Core\Cache\Cache::PERMANENT.

Overrides CacheableDependencyInterface::getCacheMaxAge

File

core/modules/system/tests/modules/entity_test/src/TypedData/ComputedString.php, line 56

Class

ComputedString
A computed property for test strings.

Namespace

Drupal\entity_test\TypedData

Code

public function getCacheMaxAge() {
  return Cache::PERMANENT;
}