class MemoryCacheFactory in Group 8
Same name and namespace in other branches
- 2.0.x src/CoreFix/Cache/MemoryCacheFactory.php \Drupal\group\CoreFix\Cache\MemoryCacheFactory
DO NOT USE! Placeholder for when core commits this properly.
@internal
Hierarchy
- class \Drupal\group\CoreFix\Cache\MemoryCacheFactory implements CacheFactoryInterface
Expanded class hierarchy of MemoryCacheFactory
1 string reference to 'MemoryCacheFactory'
1 service uses MemoryCacheFactory
File
- src/
CoreFix/ Cache/ MemoryCacheFactory.php, line 13
Namespace
Drupal\group\CoreFix\CacheView source
class MemoryCacheFactory implements CacheFactoryInterface {
/**
* Instantiated memory cache bins.
*
* @var \Drupal\Core\Cache\MemoryCache\MemoryCache[]
*/
protected $bins = [];
/**
* {@inheritdoc}
*/
public function get($bin) {
if (!isset($this->bins[$bin])) {
$this->bins[$bin] = new MemoryCache();
}
return $this->bins[$bin];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MemoryCacheFactory:: |
protected | property | Instantiated memory cache bins. | |
MemoryCacheFactory:: |
public | function |
Gets a cache backend class for a given cache bin. Overrides CacheFactoryInterface:: |