public function DatabaseStorage::rename in Drupal 10
Same name in this branch
- 10 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::rename()
- 10 core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php \Drupal\Core\KeyValueStore\DatabaseStorage::rename()
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::rename()
- 9 core/lib/Drupal/Core/Config/DatabaseStorage.php \Drupal\Core\Config\DatabaseStorage::rename()
Implements Drupal\Core\Config\StorageInterface::rename().
Throws
PDOException
File
- core/lib/ Drupal/ Core/ Config/ DatabaseStorage.php, line 237 
Class
- DatabaseStorage
- Defines the Database storage.
Namespace
Drupal\Core\ConfigCode
public function rename($name, $new_name) {
  // @todo Remove the 'return' option in Drupal 11.
  // @see https://www.drupal.org/project/drupal/issues/3256524
  $options = [
    'return' => Database::RETURN_AFFECTED,
  ] + $this->options;
  return (bool) $this->connection
    ->update($this->table, $options)
    ->fields([
    'name' => $new_name,
  ])
    ->condition('name', $name)
    ->condition('collection', $this->collection)
    ->execute();
}