class CacheRedirect in VariationCache 8
Defines a value object to represent a cache redirect with.
@internal
Hierarchy
- class \Drupal\variationcache\Cache\CacheRedirect implements CacheableDependencyInterface uses CacheableDependencyTrait
Expanded class hierarchy of CacheRedirect
See also
\Drupal\variationcache\Cache\VariationCache::get()
\Drupal\variationcache\Cache\VariationCache::set()
1 file declares its use of CacheRedirect
- VariationCacheTest.php in tests/
src/ Unit/ VariationCacheTest.php
File
- src/
Cache/ CacheRedirect.php, line 16
Namespace
Drupal\variationcache\CacheView source
class CacheRedirect implements CacheableDependencyInterface {
use CacheableDependencyTrait;
/**
* Constructs a CacheRedirect object.
*
* @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability
* The cacheability to redirect to.
*
* @see \Drupal\variationcache\Cache\VariationCache::createRedirectedCacheId()
*/
public function __construct(CacheableDependencyInterface $cacheability) {
// Cache redirects only care about cache contexts.
$this->cacheContexts = $cacheability
->getCacheContexts();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
public | function | 3 | |
CacheableDependencyTrait:: |
public | function | 3 | |
CacheableDependencyTrait:: |
public | function | 3 | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
CacheRedirect:: |
public | function | Constructs a CacheRedirect object. |