class KeyValueDatabaseFactory in Service Container 7
Same name and namespace in other branches
- 7.2 lib/Drupal/Core/KeyValueStore/KeyValueDatabaseFactory.php \Drupal\Core\KeyValueStore\KeyValueDatabaseFactory
Defines the key/value store factory for the database backend.
Hierarchy
- class \Drupal\Core\KeyValueStore\KeyValueDatabaseFactory implements KeyValueFactoryInterface
Expanded class hierarchy of KeyValueDatabaseFactory
File
- lib/
Drupal/ Core/ KeyValueStore/ KeyValueDatabaseFactory.php, line 17 - Contains \Drupal\Core\KeyValueStore\KeyValueDatabaseFactory.
Namespace
Drupal\Core\KeyValueStoreView source
class KeyValueDatabaseFactory implements KeyValueFactoryInterface {
/**
* The serialization class to use.
*
* @var \Drupal\Component\Serialization\SerializationInterface
*/
protected $serializer;
/**
* The database connection to use.
*
* @var \Drupal\Core\Database\Connection
*/
protected $connection;
/**
* Constructs this factory object.
*
* @param \Drupal\Component\Serialization\SerializationInterface $serializer
* The serialization class to use.
* @param \Drupal\Core\Database\Connection $connection
* The Connection object containing the key-value tables.
*/
function __construct(SerializationInterface $serializer, Connection $connection) {
$this->serializer = $serializer;
$this->connection = $connection;
}
/**
* {@inheritdoc}
*/
public function get($collection) {
return new DatabaseStorage($collection, $this->serializer, $this->connection);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
KeyValueDatabaseFactory:: |
protected | property | The database connection to use. | |
KeyValueDatabaseFactory:: |
protected | property | The serialization class to use. | |
KeyValueDatabaseFactory:: |
public | function |
Constructs a new key/value store for a given collection name. Overrides KeyValueFactoryInterface:: |
|
KeyValueDatabaseFactory:: |
function | Constructs this factory object. |