You are here

protected function DatabaseStorage::doWrite in Drupal 9

Same name and namespace in other branches
  1. 8 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

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 145

Class

DatabaseStorage
Defines the Database storage.

Namespace

Drupal\Core\Config

Code

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