Skip to content
KeyValueMemoryFactory.php 644 B
Newer Older
<?php

/**
 * @file
 * Contains Drupal\Core\KeyValueStore\KeyValueMemoryFactory.
 */

namespace Drupal\Core\KeyValueStore;

/**
 * Defines the key/value store factory for the memory backend.
class KeyValueMemoryFactory implements KeyValueFactoryInterface {
  /**
   * An array of keyvalue collections that are stored in memory.
   *
   * @var array
   */
  protected $collections = array();

    if (!isset($this->collections[$collection])) {
      $this->collections[$collection] = new MemoryStorage($collection);
    }
    return $this->collections[$collection];