Newer
Older
catch
committed
<?php
/**
* @file
* Contains Drupal\Core\KeyValueStore\KeyValueMemoryFactory.
*/
namespace Drupal\Core\KeyValueStore;
/**
* Defines the key/value store factory for the memory backend.
catch
committed
*/
Dries Buytaert
committed
class KeyValueMemoryFactory implements KeyValueFactoryInterface {
catch
committed
/**
* An array of keyvalue collections that are stored in memory.
*
* @var array
*/
protected $collections = array();
catch
committed
/**
Dries Buytaert
committed
* {@inheritdoc}
catch
committed
*/
public function get($collection) {
if (!isset($this->collections[$collection])) {
$this->collections[$collection] = new MemoryStorage($collection);
}
return $this->collections[$collection];