function DatabaseStorage::doWrite

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::doWrite()
  2. 8.9.x core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::doWrite()
  3. 10 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::doWrite()

Helper method so we can re-try a write.

Parameters

string $name: The config name.

string $data: The config data, already dumped to a string.

Return value

bool TRUE when the write was successful, FALSE otherwise.

1 call to DatabaseStorage::doWrite()
DatabaseStorage::write in core/lib/Drupal/Core/Config/DatabaseStorage.php
Writes configuration data to the storage.

File

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

Class

DatabaseStorage
Defines the Database storage.

Namespace

Drupal\Core\Config

Code

protected function doWrite($name, $data) {
  return (bool) $this->connection
    ->merge($this->table, $this->options)
    ->keys([
    'collection',
    'name',
  ], [
    $this->collection,
    $name,
  ])
    ->fields([
    'data' => $data,
  ])
    ->execute();
}

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