You are here

public function UpdateCacheBackendFactory::get in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Update/UpdateCacheBackendFactory.php \Drupal\Core\Update\UpdateCacheBackendFactory::get()

Gets a cache backend class for a given cache bin.

Parameters

string $bin: The cache bin for which a cache backend object should be returned.

Return value

\Drupal\Core\Cache\CacheBackendInterface The cache backend object associated with the specified bin.

Overrides CacheFactoryInterface::get

File

core/lib/Drupal/Core/Update/UpdateCacheBackendFactory.php, line 44

Class

UpdateCacheBackendFactory
Cache factory implementation for use during Drupal database updates.

Namespace

Drupal\Core\Update

Code

public function get($bin) {
  if (!isset($this->bins[$bin])) {
    $this->bins[$bin] = new UpdateBackend($this->cacheFactory
      ->get($bin), $bin);
  }
  return $this->bins[$bin];
}