function AliasManager::cacheClear

Same name in other branches
  1. 9 core/modules/path_alias/src/AliasManager.php \Drupal\path_alias\AliasManager::cacheClear()
  2. 10 core/modules/path_alias/src/AliasManager.php \Drupal\path_alias\AliasManager::cacheClear()
  3. 11.x core/modules/path_alias/src/AliasManager.php \Drupal\path_alias\AliasManager::cacheClear()

Overrides AliasManagerInterface::cacheClear

File

core/lib/Drupal/Core/Path/AliasManager.php, line 297

Class

AliasManager
The default alias manager implementation.

Namespace

Drupal\Core\Path

Code

public function cacheClear($source = NULL) {
    if ($source) {
        foreach (array_keys($this->lookupMap) as $lang) {
            unset($this->lookupMap[$lang][$source]);
        }
    }
    else {
        $this->lookupMap = [];
    }
    $this->noPath = [];
    $this->noAlias = [];
    $this->langcodePreloaded = [];
    $this->preloadedPathLookups = [];
    $this->cache
        ->delete($this->cacheKey);
    $this->pathAliasWhitelistRebuild($source);
}

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