public function KeyValueDatabaseFactory::get

public KeyValueDatabaseFactory::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/KeyValueDatabaseFactory.php, line 43

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->serializer, $this->connection);
}

© 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!KeyValueDatabaseFactory.php/function/KeyValueDatabaseFactory::get/8.1.x