class KeyValueMemoryFactory in Service Container 7.2
Same name and namespace in other branches
- 7 lib/Drupal/Core/KeyValueStore/KeyValueMemoryFactory.php \Drupal\Core\KeyValueStore\KeyValueMemoryFactory
Defines the key/value store factory for the memory backend.
Hierarchy
- class \Drupal\Core\KeyValueStore\KeyValueMemoryFactory implements KeyValueFactoryInterface
Expanded class hierarchy of KeyValueMemoryFactory
File
- lib/
Drupal/ Core/ KeyValueStore/ KeyValueMemoryFactory.php, line 13 - Contains \Drupal\Core\KeyValueStore\KeyValueMemoryFactory.
Namespace
Drupal\Core\KeyValueStoreView source
class KeyValueMemoryFactory implements KeyValueFactoryInterface {
/**
* An array of keyvalue collections that are stored in memory.
*
* @var array
*/
protected $collections = array();
/**
* {@inheritdoc}
*/
public function get($collection) {
if (!isset($this->collections[$collection])) {
$this->collections[$collection] = new MemoryStorage($collection);
}
return $this->collections[$collection];
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
KeyValueMemoryFactory:: |
protected | property | An array of keyvalue collections that are stored in memory. | |
KeyValueMemoryFactory:: |
public | function |
Constructs a new key/value store for a given collection name. Overrides KeyValueFactoryInterface:: |