3 namespace Drupal\entity_test\Cache;
5 use Drupal\Core\Cache\CacheableMetadata;
6 use Drupal\Core\Cache\Context\CacheContextInterface;
9 * Defines the entity_test view grants cache context service.
11 * Cache context ID: 'entity_test_view_grants'.
13 * @see \Drupal\node\Cache\NodeAccessViewGrantsCacheContext
15 class EntityTestViewGrantsCacheContext implements CacheContextInterface {
20 public static function getLabel() {
21 return t("Entity test view grants");
27 public function getContext() {
28 // Return a constant value, so we can fetch render cache both in actual
29 // requests and test code itself.
36 public function getCacheableMetadata() {
37 return new CacheableMetadata();