public function MemoryStorage::rename in Service Container 7
Same name and namespace in other branches
- 7.2 lib/Drupal/Core/KeyValueStore/MemoryStorage.php \Drupal\Core\KeyValueStore\MemoryStorage::rename()
Renames a key.
Parameters
string $key: The key to rename.
string $new_key: The new key name.
Overrides KeyValueStoreInterface::rename
File
- lib/
Drupal/ Core/ KeyValueStore/ MemoryStorage.php, line 78 - Contains \Drupal\Core\KeyValueStore\MemoryStorage.
Class
- MemoryStorage
- Defines a default key/value store implementation.
Namespace
Drupal\Core\KeyValueStoreCode
public function rename($key, $new_key) {
$this->data[$new_key] = $this->data[$key];
unset($this->data[$key]);
}