class MemoryBackendFactory

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Cache/MemoryBackendFactory.php \Drupal\Core\Cache\MemoryBackendFactory
  2. 8.9.x core/lib/Drupal/Core/Cache/MemoryBackendFactory.php \Drupal\Core\Cache\MemoryBackendFactory
  3. 10 core/lib/Drupal/Core/Cache/MemoryBackendFactory.php \Drupal\Core\Cache\MemoryBackendFactory

Hierarchy

Expanded class hierarchy of MemoryBackendFactory

1 file declares its use of MemoryBackendFactory
NormalInstallerServiceProvider.php in core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php

File

core/lib/Drupal/Core/Cache/MemoryBackendFactory.php, line 7

Namespace

Drupal\Core\Cache
View source
class MemoryBackendFactory implements CacheFactoryInterface {
    
    /**
     * Instantiated memory cache bins.
     *
     * @var \Drupal\Core\Cache\MemoryBackend[]
     */
    protected $bins = [];
    
    /**
     * Constructs a MemoryBackendFactory object.
     *
     * @param \Drupal\Component\Datetime\TimeInterface $time
     *   The time service.
     */
    public function __construct(TimeInterface $time) {
    }
    
    /**
     * {@inheritdoc}
     */
    public function get($bin) {
        if (!isset($this->bins[$bin])) {
            $this->bins[$bin] = new MemoryBackend($this->time);
        }
        return $this->bins[$bin];
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
MemoryBackendFactory::$bins protected property Instantiated memory cache bins.
MemoryBackendFactory::get public function Gets a cache backend class for a given cache bin. Overrides CacheFactoryInterface::get
MemoryBackendFactory::__construct public function Constructs a MemoryBackendFactory object.

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