public function ConfigFactory::reset

public ConfigFactory::reset($name = NULL)

Resets and re-initializes configuration objects. Internal use only.

Parameters

string|null $name: (optional) The name of the configuration object to reset. If omitted, all configuration objects are reset.

Return value

$this

Overrides ConfigFactoryInterface::reset

File

core/lib/Drupal/Core/Config/ConfigFactory.php, line 231

Class

ConfigFactory
Defines the configuration object factory.

Namespace

Drupal\Core\Config

Code

public function reset($name = NULL) {
  if ($name) {
    // Clear all cached configuration for this name.
    foreach ($this->getConfigCacheKeys($name) as $cache_key) {
      unset($this->cache[$cache_key]);
    }
  }
  else {
    $this->cache = array();
  }

  // Clear the static list cache if supported by the storage.
  if ($this->storage instanceof StorageCacheInterface) {
    $this->storage->resetListCache();
  }
  return $this;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!ConfigFactory.php/function/ConfigFactory::reset/8.1.x