DatabaseStorageExpirable

Defines a default key/value store implementation for expiring items. This key/value store implementation uses the database to store key/value data with an expire date. Hierarchy class \Drupal\Core\KeyValueStore\StorageBase implements KeyValueStoreInterfaceclass \Drupal\Core\KeyValueStore\DatabaseStorage uses DependencySerializationTraitclass \Drupal\Core\KeyValueStore\DatabaseStorageExpirable implements KeyValueStoreExpirableInterface File core/lib/Drupal/Core/KeyValueStore/DatabaseStorage

DatabaseStorage::__construct

public DatabaseStorage::__construct(Connection $connection, $table, array $options = array(), $collection = StorageInterface::DEFAULT_COLLECTION) 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)

DatabaseStorage::__construct

public DatabaseStorage::__construct($collection, SerializationInterface $serializer, Connection $connection, $table = 'key_value') Overrides Drupal\Core\KeyValueStore\StorageBase::__construct(). Parameters string $collection: The name of the collection holding key and value pairs. \Drupal\Component\Serialization\SerializationInterface $serializer: The serialization class to use. \Drupal\Core\Database\Connection $connection: The database connection to use. string $table: The name of the SQL tab

DatabaseStorage::write

public DatabaseStorage::write($name, array $data) Writes configuration data to the storage. Parameters string $name: The name of a configuration object to save. array $data: The configuration data to write. Return value bool TRUE on success, FALSE in case of an error. Throws \Drupal\Core\Config\StorageException If the back-end storage does not exist and cannot be created. Overrides StorageInterface::write File core/lib/Drupal/Core/Config/DatabaseStorage.php, line 120 Class DatabaseStorag

DatabaseStorage::setIfNotExists

public DatabaseStorage::setIfNotExists($key, $value) Saves a value for a given key if it does not exist yet. Parameters string $key: The key of the data to store. mixed $value: The data to store. Return value bool TRUE if the data was set, FALSE if it already existed. Overrides KeyValueStoreInterface::setIfNotExists File core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php, line 122 Class DatabaseStorage Defines a default key/value store implementation. Namespace Drupal\Core\KeyValu

DatabaseStorage::set

public DatabaseStorage::set($key, $value) Saves a value for a given key. Parameters string $key: The key of the data to store. mixed $value: The data to store. Overrides KeyValueStoreInterface::set File core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php, line 109 Class DatabaseStorage Defines a default key/value store implementation. Namespace Drupal\Core\KeyValueStore Code public function set($key, $value) { $this->connection->merge($this->table) ->keys(array(

DatabaseStorage::schemaDefinition

protected static DatabaseStorage::schemaDefinition() Defines the schema for the configuration table. File core/lib/Drupal/Core/Config/DatabaseStorage.php, line 184 Class DatabaseStorage Defines the Database storage. Namespace Drupal\Core\Config Code protected static function schemaDefinition() { $schema = array( 'description' => 'The base table for configuration data.', 'fields' => array( 'collection' => array( 'description' => 'Primary Key: Config o

DatabaseStorage::rename

public DatabaseStorage::rename($key, $new_key) Renames a key. Parameters string $key: The key to rename. string $new_key: The new key name. Overrides KeyValueStoreInterface::rename File core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php, line 138 Class DatabaseStorage Defines a default key/value store implementation. Namespace Drupal\Core\KeyValueStore Code public function rename($key, $new_key) { $this->connection->update($this->table) ->fields(array('name' =>

DatabaseStorage::rename

public DatabaseStorage::rename($name, $new_name) Implements Drupal\Core\Config\StorageInterface::rename(). Throws PDOException Overrides StorageInterface::rename File core/lib/Drupal/Core/Config/DatabaseStorage.php, line 235 Class DatabaseStorage Defines the Database storage. Namespace Drupal\Core\Config Code public function rename($name, $new_name) { $options = array('return' => Database::RETURN_AFFECTED) + $this->options; return (bool) $this->connection->update($this

DatabaseStorage::readMultiple

public DatabaseStorage::readMultiple(array $names) Reads configuration data from the storage. Parameters array $names: List of names of the configuration objects to load. Return value array A list of the configuration data stored for the configuration object name that could be loaded for the passed list of names. Overrides StorageInterface::readMultiple File core/lib/Drupal/Core/Config/DatabaseStorage.php, line 102 Class DatabaseStorage Defines the Database storage. Namespace Drupal\C