function TestCacheOptionalBlock::getCacheMaxAge
Overrides ContextAwarePluginTrait::getCacheMaxAge
File
-
core/
modules/ block/ tests/ modules/ block_test/ src/ Plugin/ Block/ TestCacheOptionalBlock.php, line 44
Class
- TestCacheOptionalBlock
- Provides a block implementing CacheOptionalInterface to test its caching.
Namespace
Drupal\block_test\Plugin\BlockCode
public function getCacheMaxAge() : int {
return \Drupal::state()->get('block_test.cache_max_age', parent::getCacheMaxAge());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.