public function TestCacheBlock::getCacheMaxAge in Drupal 8
Same name and namespace in other branches
- 9 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestCacheBlock.php \Drupal\block_test\Plugin\Block\TestCacheBlock::getCacheMaxAge()
- 10 core/modules/block/tests/modules/block_test/src/Plugin/Block/TestCacheBlock.php \Drupal\block_test\Plugin\Block\TestCacheBlock::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.
Overrides ContextAwarePluginBase::getCacheMaxAge
File
- core/
modules/ block/ tests/ modules/ block_test/ src/ Plugin/ Block/ TestCacheBlock.php, line 40
Class
- TestCacheBlock
- Provides a block to test caching.
Namespace
Drupal\block_test\Plugin\BlockCode
public function getCacheMaxAge() {
return \Drupal::state()
->get('block_test.cache_max_age', parent::getCacheMaxAge());
}