You are here

class MemoryBackendFactory in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Cache/MemoryBackendFactory.php \Drupal\Core\Cache\MemoryBackendFactory

Hierarchy

Expanded class hierarchy of MemoryBackendFactory

1 string reference to 'MemoryBackendFactory'
core.services.yml in core/core.services.yml
core/core.services.yml
1 service uses MemoryBackendFactory
cache.backend.memory in core/core.services.yml
Drupal\Core\Cache\MemoryBackendFactory

File

core/lib/Drupal/Core/Cache/MemoryBackendFactory.php, line 10
Contains \Drupal\Core\Cache\MemoryBackendFactory.

Namespace

Drupal\Core\Cache
View source
class MemoryBackendFactory implements CacheFactoryInterface {

  /**
   * Instantiated memory cache bins.
   *
   * @var \Drupal\Core\Cache\MemoryBackend[]
   */
  protected $bins = array();

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

}

Members

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