You are here

public function VariationCacheFactory::get in VariationCache 8

Gets a variation cache backend for a given cache bin.

Parameters

string $bin: The cache bin for which a variation cache backend should be returned.

Return value

\Drupal\variationcache\Cache\VariationCacheInterface The variation cache backend associated with the specified bin.

Overrides VariationCacheFactoryInterface::get

File

src/Cache/VariationCacheFactory.php, line 63

Class

VariationCacheFactory
Defines the variation cache factory.

Namespace

Drupal\variationcache\Cache

Code

public function get($bin) {
  if (!isset($this->bins[$bin])) {
    $this->bins[$bin] = new VariationCache($this->requestStack, $this->cacheFactory
      ->get($bin), $this->cacheContextsManager);
  }
  return $this->bins[$bin];
}