function AliasPrefixList::get

Overrides CacheCollector::get

File

core/modules/path_alias/src/AliasPrefixList.php, line 83

Class

AliasPrefixList
Cache a list of valid alias prefixes.

Namespace

Drupal\path_alias

Code

public function get($offset) {
    $this->lazyLoadCache();
    // This may be called with paths that are not represented by menu router
    // items such as paths that will be rewritten by hook_url_outbound_alter().
    // Therefore internally TRUE is used to indicate valid paths. FALSE is
    // used to indicate paths that have already been checked but are not
    // valid, and NULL indicates paths that have not been checked yet.
    if (isset($this->storage[$offset])) {
        if ($this->storage[$offset]) {
            return TRUE;
        }
    }
    elseif (array_key_exists($offset, $this->storage)) {
        return $this->resolveCacheMiss($offset);
    }
}

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