Instantiates a cache backend class for a given cache bin.
By default, this returns an instance of the Drupal\Core\Cache\DatabaseBackend class.
Classes implementing Drupal\Core\Cache\CacheBackendInterface can register themselves both as a default implementation and for specific bins.
string $bin: The cache bin for which a cache backend object should be returned.
Drupal\Core\Cache\CacheBackendInterface The cache backend object associated with the specified bin.
public static function get($bin) {
// Check whether there is a custom class defined for the requested bin or
// use the default 'cache' definition otherwise.
$cache_backends = self::getBackends();
$class = isset($cache_backends[$bin]) ? $cache_backends[$bin] : $cache_backends['cache'];
return new $class($bin);
}