function AliasWhitelist::loadMenuPathRoots

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Path/AliasWhitelist.php \Drupal\Core\Path\AliasWhitelist::loadMenuPathRoots()
  2. 10 core/modules/path_alias/src/AliasWhitelist.php \Drupal\path_alias\AliasWhitelist::loadMenuPathRoots()

Loads menu path roots to prepopulate cache.

2 calls to AliasWhitelist::loadMenuPathRoots()
AliasWhitelist::clear in core/modules/path_alias/src/AliasWhitelist.php
Clears the collected cache entry.
AliasWhitelist::lazyLoadCache in core/modules/path_alias/src/AliasWhitelist.php
Loads the cache if not already done.

File

core/modules/path_alias/src/AliasWhitelist.php, line 71

Class

AliasWhitelist
Extends CacheCollector to build the path alias whitelist over time.

Namespace

Drupal\path_alias

Code

protected function loadMenuPathRoots() {
    if ($roots = $this->state
        ->get('router.path_roots')) {
        foreach ($roots as $root) {
            $this->storage[$root] = NULL;
            $this->persist($root);
        }
    }
}

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