class ShsTermCacheDependency in Simple hierarchical select 8
Same name and namespace in other branches
- 2.0.x src/Cache/ShsTermCacheDependency.php \Drupal\shs\Cache\ShsTermCacheDependency
Cacheable dependency object for term data.
Hierarchy
- class \Drupal\shs\Cache\ShsTermCacheDependency implements CacheableDependencyInterface
Expanded class hierarchy of ShsTermCacheDependency
1 file declares its use of ShsTermCacheDependency
- ShsController.php in src/
Controller/ ShsController.php
File
- src/
Cache/ ShsTermCacheDependency.php, line 11
Namespace
Drupal\shs\CacheView source
class ShsTermCacheDependency implements CacheableDependencyInterface {
/**
* {@inheritdoc}
*/
public function __construct($tags = []) {
$this->contexts = [
'languages:language_interface',
];
$this->tags = Cache::mergeTags([
'taxonomy_term_values',
], $tags);
$this->maxAge = Cache::PERMANENT;
}
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
return $this->contexts;
}
/**
* {@inheritdoc}
*/
public function getCacheTags() {
return Cache::mergeTags($this->tags, \Drupal::entityTypeManager()
->getDefinition('taxonomy_term')
->getListCacheTags());
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
return $this->maxAge;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ShsTermCacheDependency:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyInterface:: |
|
ShsTermCacheDependency:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyInterface:: |
|
ShsTermCacheDependency:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyInterface:: |
|
ShsTermCacheDependency:: |
public | function |