public function KeyValueDatabaseFactory::get

Constructs a new key/value database storage object for a given collection name.

Parameters

string $collection: The name of the collection holding key and value pairs.

\Drupal\Core\Database\Connection $connection: The connection to run against.

Return value

\Drupal\Core\KeyValueStore\DatabaseStorage A key/value store implementation for the given $collection.

1 method overrides KeyValueDatabaseFactory::get()
KeyValueDatabaseExpirableFactory::get in drupal/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php
Constructs a new key/value expirable database storage object for a given collection name.

File

drupal/core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseFactory.php, line 38
Contains Drupal\Core\KeyValueStore\KeyValueDatabaseFactory.

Class

KeyValueDatabaseFactory
Defines the key/value store factory for the database backend.

Namespace

Drupal\Core\KeyValueStore

Code

public function get($collection) {
  return new DatabaseStorage($collection, $this->connection);
}