function ConfigurableLanguageManager::reset

Same name in other branches
  1. 8.9.x core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::reset()
  2. 10 core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::reset()
  3. 11.x core/modules/language/src/ConfigurableLanguageManager.php \Drupal\language\ConfigurableLanguageManager::reset()

Overrides LanguageManager::reset

File

core/modules/language/src/ConfigurableLanguageManager.php, line 241

Class

ConfigurableLanguageManager
Overrides default LanguageManager to provide configured languages.

Namespace

Drupal\language

Code

public function reset($type = NULL) {
    if (!isset($type)) {
        $this->initialized = FALSE;
        $this->negotiatedLanguages = [];
        $this->negotiatedMethods = [];
        $this->languageTypes = NULL;
        $this->languageTypesInfo = NULL;
        $this->languages = [];
        if ($this->negotiator) {
            $this->negotiator
                ->reset();
        }
    }
    elseif (isset($this->negotiatedLanguages[$type])) {
        unset($this->negotiatedLanguages[$type]);
        unset($this->negotiatedMethods[$type]);
    }
    return $this;
}

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