You are here

class MemoryCounterBackendFactory in Drupal 10

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

Hierarchy

Expanded class hierarchy of MemoryCounterBackendFactory

1 file declares its use of MemoryCounterBackendFactory
MigrateSqlSourceTestBase.php in core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php

File

core/lib/Drupal/Core/Cache/MemoryCounterBackendFactory.php, line 5

Namespace

Drupal\Core\Cache
View source
class MemoryCounterBackendFactory 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 MemoryCounterBackend();
    }
    return $this->bins[$bin];
  }

}

Members