class ViewsTestCacheContext in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/tests/modules/views_test_data/src/Cache/ViewsTestCacheContext.php \Drupal\views_test_data\Cache\ViewsTestCacheContext
Test cache context which uses a dynamic context coming from state.
Cache context ID: 'views_test_cache_context'.
Hierarchy
- class \Drupal\views_test_data\Cache\ViewsTestCacheContext implements CacheContextInterface
Expanded class hierarchy of ViewsTestCacheContext
1 string reference to 'ViewsTestCacheContext'
- views_test_data.services.yml in core/
modules/ views/ tests/ modules/ views_test_data/ views_test_data.services.yml - core/modules/views/tests/modules/views_test_data/views_test_data.services.yml
1 service uses ViewsTestCacheContext
- cache_context.views_test_cache_context in core/
modules/ views/ tests/ modules/ views_test_data/ views_test_data.services.yml - Drupal\views_test_data\Cache\ViewsTestCacheContext
File
- core/
modules/ views/ tests/ modules/ views_test_data/ src/ Cache/ ViewsTestCacheContext.php, line 18 - Contains \Drupal\views_test_data\Cache\ViewsTestCacheContext.
Namespace
Drupal\views_test_data\CacheView source
class ViewsTestCacheContext implements CacheContextInterface {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t('Views test cache context');
}
/**
* {@inheritdoc}
*/
public function getContext() {
return \Drupal::state()
->get('views_test_cache_context', 'George');
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata() {
return new CacheableMetadata();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ViewsTestCacheContext:: |
public | function |
Gets the cacheability metadata for the context. Overrides CacheContextInterface:: |
|
ViewsTestCacheContext:: |
public | function |
Returns the string representation of the cache context. Overrides CacheContextInterface:: |
|
ViewsTestCacheContext:: |
public static | function |
Returns the label of the cache context. Overrides CacheContextInterface:: |