class EntityTestViewGrantsCacheContext in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php \Drupal\entity_test\Cache\EntityTestViewGrantsCacheContext
Defines the entity_test view grants cache context service.
Cache context ID: 'entity_test_view_grants'.
Hierarchy
- class \Drupal\entity_test\Cache\EntityTestViewGrantsCacheContext implements CacheContextInterface
Expanded class hierarchy of EntityTestViewGrantsCacheContext
See also
\Drupal\node\Cache\NodeAccessViewGrantsCacheContext
1 string reference to 'EntityTestViewGrantsCacheContext'
- entity_test.services.yml in core/
modules/ system/ tests/ modules/ entity_test/ entity_test.services.yml - core/modules/system/tests/modules/entity_test/entity_test.services.yml
1 service uses EntityTestViewGrantsCacheContext
- cache_context.entity_test_view_grants in core/
modules/ system/ tests/ modules/ entity_test/ entity_test.services.yml - Drupal\entity_test\Cache\EntityTestViewGrantsCacheContext
File
- core/
modules/ system/ tests/ modules/ entity_test/ src/ Cache/ EntityTestViewGrantsCacheContext.php, line 15
Namespace
Drupal\entity_test\CacheView source
class EntityTestViewGrantsCacheContext implements CacheContextInterface {
/**
* {@inheritdoc}
*/
public static function getLabel() {
return t("Entity test view grants");
}
/**
* {@inheritdoc}
*/
public function getContext() {
// Return a constant value, so we can fetch render cache both in actual
// requests and test code itself.
return '299792458';
}
/**
* {@inheritdoc}
*/
public function getCacheableMetadata() {
return new CacheableMetadata();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityTestViewGrantsCacheContext:: |
public | function |
Gets the cacheability metadata for the context. Overrides CacheContextInterface:: |
|
EntityTestViewGrantsCacheContext:: |
public | function |
Returns the string representation of the cache context. Overrides CacheContextInterface:: |
|
EntityTestViewGrantsCacheContext:: |
public static | function |
Returns the label of the cache context. Overrides CacheContextInterface:: |