function KeyValueDatabaseExpirableFactory::get

Same name in other branches
  1. 9 core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::get()
  2. 8.9.x core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::get()
  3. 10 core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseExpirableFactory::get()

Overrides KeyValueExpirableFactoryInterface::get

File

core/lib/Drupal/Core/KeyValueStore/KeyValueDatabaseExpirableFactory.php, line 41

Class

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

Namespace

Drupal\Core\KeyValueStore

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.