You are here

public function ConfigSnapshotStorage::rename in Config Snapshot 8

Renames a configuration object in the storage.

Parameters

string $name: The name of a configuration object to rename.

string $new_name: The new name of a configuration object.

Return value

bool TRUE on success, FALSE otherwise.

Overrides StorageInterface::rename

File

src/ConfigSnapshotStorage.php, line 157

Class

ConfigSnapshotStorage
Provides a configuration storage saved as simple configuration.

Namespace

Drupal\config_snapshot

Code

public function rename($name, $new_name) {
  if (!$this
    ->exists($name)) {
    return FALSE;
  }
  $this
    ->write($new_name, $this
    ->read($name));
  return $this
    ->delete($name);
}