function DatabaseStorage::__construct

Same name in this branch
  1. 8.9.x core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::__construct()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::__construct()
  2. 9 core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::__construct()
  3. 10 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::__construct()
  4. 10 core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::__construct()
  5. 11.x core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::__construct()
  6. 11.x core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::__construct()

Constructs a new DatabaseStorage.

Parameters

\Drupal\Core\Database\Connection $connection: A Database connection to use for reading and writing configuration data.

string $table: A database table name to store configuration data in.

array $options: (optional) Any additional database connection options to use in queries.

string $collection: (optional) The collection to store configuration in. Defaults to the default collection.

File

core/lib/Drupal/Core/Config/DatabaseStorage.php, line 57

Class

DatabaseStorage
Defines the Database storage.

Namespace

Drupal\Core\Config

Code

public function __construct(Connection $connection, $table, array $options = [], $collection = StorageInterface::DEFAULT_COLLECTION) {
    $this->connection = $connection;
    $this->table = $table;
    $this->options = $options;
    $this->collection = $collection;
}

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