You are here

public function AliasManager::cacheClear in Drupal 8

Clear internal caches in alias manager.

Parameters

$source: Source path of the alias that is being inserted/updated. Can be omitted if entire cache needs to be flushed.

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);
}