function AliasStorage::lookupPathSource

Overrides AliasStorageInterface::lookupPathSource

File

core/lib/Drupal/Core/Path/AliasStorage.php, line 240

Class

AliasStorage
Provides a class for CRUD operations on path aliases.

Namespace

Drupal\Core\Path

Code

public function lookupPathSource($alias, $langcode) {
    // See the queries above. Use LIKE for case-insensitive matching.
    $select = $this->getBaseQuery()
        ->fields('base_table', [
        'path',
    ])
        ->condition('base_table.alias', $this->connection
        ->escapeLike($alias), 'LIKE');
    $this->addLanguageFallback($select, $langcode);
    $select->orderBy('base_table.id', 'DESC');
    return $select->execute()
        ->fetchField();
}

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