You are here

public function MemoryCacheFactory::get in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/CoreFix/Cache/MemoryCacheFactory.php \Drupal\group\CoreFix\Cache\MemoryCacheFactory::get()

Gets a cache backend class for a given cache bin.

Parameters

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

Return value

\Drupal\Core\Cache\CacheBackendInterface The cache backend object associated with the specified bin.

Overrides CacheFactoryInterface::get

File

src/CoreFix/Cache/MemoryCacheFactory.php, line 25

Class

MemoryCacheFactory
DO NOT USE! Placeholder for when core commits this properly.

Namespace

Drupal\group\CoreFix\Cache

Code

public function get($bin) {
  if (!isset($this->bins[$bin])) {
    $this->bins[$bin] = new MemoryCache();
  }
  return $this->bins[$bin];
}