function MemoryStorage::delete

Same name in this branch
  1. 11.x core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php \Drupal\Core\KeyValueStore\MemoryStorage::delete()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/MemoryStorage.php \Drupal\Core\Config\MemoryStorage::delete()
  2. 9 core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php \Drupal\Core\KeyValueStore\MemoryStorage::delete()
  3. 8.9.x core/lib/Drupal/Core/Config/MemoryStorage.php \Drupal\Core\Config\MemoryStorage::delete()
  4. 8.9.x core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php \Drupal\Core\KeyValueStore\MemoryStorage::delete()
  5. 10 core/lib/Drupal/Core/Config/MemoryStorage.php \Drupal\Core\Config\MemoryStorage::delete()
  6. 10 core/lib/Drupal/Core/KeyValueStore/MemoryStorage.php \Drupal\Core\KeyValueStore\MemoryStorage::delete()

Overrides StorageInterface::delete

File

core/lib/Drupal/Core/Config/MemoryStorage.php, line 73

Class

MemoryStorage
Provides an in memory configuration storage.

Namespace

Drupal\Core\Config

Code

public function delete($name) {
    if (isset($this->config[$this->collection][$name])) {
        unset($this->config[$this->collection][$name]);
        // Remove the collection if it is empty.
        if (empty($this->config[$this->collection])) {
            $this->config
                ->offsetUnset($this->collection);
        }
        return TRUE;
    }
    return FALSE;
}

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