You are here

class MemoryCacheFactory in Group 2.0.x

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

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

@internal

Hierarchy

Expanded class hierarchy of MemoryCacheFactory

1 string reference to 'MemoryCacheFactory'
group.services.yml in ./group.services.yml
group.services.yml
1 service uses MemoryCacheFactory
cache.backend.corefix_memory_no_serialize in ./group.services.yml
Drupal\group\CoreFix\Cache\MemoryCacheFactory

File

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

Namespace

Drupal\group\CoreFix\Cache
View source
class MemoryCacheFactory implements CacheFactoryInterface {

  /**
   * Instantiated memory cache bins.
   *
   * @var \Drupal\Core\Cache\MemoryCache\MemoryCache[]
   */
  protected $bins = [];

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

}

Members

Namesort descending Modifiers Type Description Overrides
MemoryCacheFactory::$bins protected property Instantiated memory cache bins.
MemoryCacheFactory::get public function Gets a cache backend class for a given cache bin. Overrides CacheFactoryInterface::get