MemoryBackendFactory.php

Same filename in other branches
  1. 8.9.x core/lib/Drupal/Core/Cache/MemoryBackendFactory.php
  2. 10 core/lib/Drupal/Core/Cache/MemoryBackendFactory.php
  3. 11.x core/lib/Drupal/Core/Cache/MemoryBackendFactory.php

Namespace

Drupal\Core\Cache

File

core/lib/Drupal/Core/Cache/MemoryBackendFactory.php

View source
<?php

namespace Drupal\Core\Cache;

class MemoryBackendFactory implements CacheFactoryInterface {
    
    /**
     * Instantiated memory cache bins.
     *
     * @var \Drupal\Core\Cache\MemoryBackend[]
     */
    protected $bins = [];
    
    /**
     * {@inheritdoc}
     */
    public function get($bin) {
        if (!isset($this->bins[$bin])) {
            $this->bins[$bin] = new MemoryBackend();
        }
        return $this->bins[$bin];
    }

}

Classes

Title Deprecated Summary
MemoryBackendFactory

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