CacheRedirect.php

Same filename in other branches
  1. 10 core/lib/Drupal/Core/Cache/CacheRedirect.php

Namespace

Drupal\Core\Cache

File

core/lib/Drupal/Core/Cache/CacheRedirect.php

View source
<?php

namespace Drupal\Core\Cache;


/**
 * Defines a value object to represent a cache redirect.
 *
 * @see \Drupal\Core\Cache\VariationCache::get()
 * @see \Drupal\Core\Cache\VariationCache::set()
 *
 * @ingroup cache
 * @internal
 */
class CacheRedirect implements CacheableDependencyInterface {
    use CacheableDependencyTrait;
    
    /**
     * Constructs a CacheRedirect object.
     *
     * @param \Drupal\Core\Cache\CacheableDependencyInterface $cacheability
     *   The cacheability to redirect to.
     *
     * @see \Drupal\Core\Cache\VariationCache::createCacheIdFast()
     */
    public function __construct(CacheableDependencyInterface $cacheability) {
        // Cache redirects only care about cache contexts.
        $this->cacheContexts = $cacheability->getCacheContexts();
    }

}

Classes

Title Deprecated Summary
CacheRedirect Defines a value object to represent a cache redirect.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.