EntityTestViewGrantsCacheContext.php
Same filename in other branches
Namespace
Drupal\entity_test\CacheFile
-
core/
modules/ system/ tests/ modules/ entity_test/ src/ Cache/ EntityTestViewGrantsCacheContext.php
View source
<?php
declare (strict_types=1);
namespace Drupal\entity_test\Cache;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Cache\Context\CacheContextInterface;
/**
* Defines the entity_test view grants cache context service.
*
* Cache context ID: 'entity_test_view_grants'.
*
* @see \Drupal\node\Cache\NodeAccessViewGrantsCacheContext
*/
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();
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
EntityTestViewGrantsCacheContext | Defines the entity_test view grants cache context service. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.