You are here

public function KeyValueDatabaseExpirableFactory::get in Service Container 7.2

Same name in this branch
  1. 7.2 src/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\service_container\KeyValueStore\KeyValueDatabaseExpirableFactory::get()
  2. 7.2 lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::get()
Same name and namespace in other branches
  1. 7 src/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\service_container\KeyValueStore\KeyValueDatabaseExpirableFactory::get()

Constructs a new expirable 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\KeyValueStoreExpirableInterface An expirable key/value store implementation for the given $collection.

Overrides KeyValueDatabaseExpirableFactory::get

File

src/KeyValueStore/KeyValueDatabaseExpirableFactory.php, line 18
Contains \Drupal\service_container\KeyValueStore\KeyValueDatabaseExpirableFactory.

Class

KeyValueDatabaseExpirableFactory
@codeCoverageIgnore

Namespace

Drupal\service_container\KeyValueStore

Code

public function get($collection) {
  if (!isset($this->storages[$collection])) {
    $this->storages[$collection] = new DatabaseStorageExpirable($collection, $this->serializer, $this->connection);
  }
  return $this->storages[$collection];
}