You are here

class CacheRedirect in VariationCache 8

Defines a value object to represent a cache redirect with.

@internal

Hierarchy

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\Cache
View 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

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::getCacheContexts public function 3
CacheableDependencyTrait::getCacheMaxAge public function 3
CacheableDependencyTrait::getCacheTags public function 3
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
CacheRedirect::__construct public function Constructs a CacheRedirect object.