public function KeyValueMemoryFactory::get
public KeyValueMemoryFactory::get($collection)
Constructs a new key/value store for a given collection name.
Parameters
string $collection: The name of the collection holding key and value pairs.
Return value
\Drupal\Core\KeyValueStore\KeyValueStoreInterface A key/value store implementation for the given $collection.
Overrides KeyValueFactoryInterface::get
File
- core/lib/Drupal/Core/KeyValueStore/KeyValueMemoryFactory.php, line 20
Class
- KeyValueMemoryFactory
- Defines the key/value store factory for the memory backend.
Namespace
Drupal\Core\KeyValueStoreCode
public function get($collection) { if (!isset($this->collections[$collection])) { $this->collections[$collection] = new MemoryStorage($collection); } return $this->collections[$collection]; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!KeyValueStore!KeyValueMemoryFactory.php/function/KeyValueMemoryFactory::get/8.1.x