public function lookupPathAliases($path, $langcode) {
    $source = $this->connection->escapeLike($path);
    $langcode_list = [$langcode, LanguageInterface::LANGCODE_NOT_SPECIFIED];
    $alias_table = 'url_alias';

    // See the queries above. Use LIKE for case-insensitive matching.
    $select = $this->connection->select($alias_table)
      ->fields($alias_table, ['alias'])
      ->condition('source', $source, 'LIKE');
    if ($langcode == LanguageInterface::LANGCODE_NOT_SPECIFIED) {
      array_pop($langcode_list);
    }
    elseif ($langcode > LanguageInterface::LANGCODE_NOT_SPECIFIED) {
      $select->orderBy('langcode', 'DESC');
    }
    else {
      $select->orderBy('langcode', 'ASC');
    }

    $select->orderBy('pid', 'DESC');
    $select->condition('langcode', $langcode_list, 'IN');
    try {
      return $select->execute()->fetchall();
    }
    catch (\Exception $e) {
      $this->catchException($e);
      return FALSE;
    }
  }
public function lookupPathAliases($path, $langcode) {
    $source = $this->connection->escapeLike($path);
    $langcode_list = [$langcode, LanguageInterface::LANGCODE_NOT_SPECIFIED];
    $alias_table = 'url_alias';

    // See the queries above. Use LIKE for case-insensitive matching.
    $select = $this->connection->select($alias_table)
      ->fields($alias_table, ['alias'])
      ->condition('source', $source, 'LIKE');
    if ($langcode == LanguageInterface::LANGCODE_NOT_SPECIFIED) {
      array_pop($langcode_list);
    }
    elseif ($langcode > LanguageInterface::LANGCODE_NOT_SPECIFIED) {
      $select->orderBy('langcode', 'DESC');
    }
    else {
      $select->orderBy('langcode', 'ASC');
    }

    $select->orderBy('pid', 'DESC');
    $select->condition('langcode', $langcode_list, 'IN');
    try {
      return $select->execute()->fetchall();
    }
    catch (\Exception $e) {
      $this->catchException($e);
      return FALSE;
    }
  }
public function lookupPathAliases ( $ path , $ langcode ) { $ source = $ this -> connection -> escapeLike ( $ path ) ; $ langcode_list = [ $ langcode , LanguageInterface :: LANGCODE_NOT_SPECIFIED ] ; $ alias_table = 'url_alias' ; // See the queries above. Use LIKE for case-insensitive matching. $ select = $ this -> connection -> select ( $ alias_table ) -> fields ( $ alias_table , [ 'alias' ] ) -> condition ( 'source' , $ source , 'LIKE' ) ; if ( $ langcode == LanguageInterface :: LANGCODE_NOT_SPECIFIED ) { array_pop ( $ langcode_list ) ; } elseif ( $ langcode > LanguageInterface :: LANGCODE_NOT_SPECIFIED ) { $ select -> orderBy ( 'langcode' , 'DESC' ) ; } else { $ select -> orderBy ( 'langcode' , 'ASC' ) ; } $ select -> orderBy ( 'pid' , 'DESC' ) ; $ select -> condition ( 'langcode' , $ langcode_list , 'IN' ) ; try { return $ select -> execute ( ) -> fetchall ( ) ; } catch ( \ Exception $ e ) { $ this -> catchException ( $ e ) ; return FALSE ; } }
Returns all aliases of Drupal system URL.

Neither AliasManagerInterface or
AliasStorageInterface have a method to get all aliases for a path.

@param string $path
The path to investigate for corresponding path aliases.
@param string $langcode
Language code to search the path with. If there's no path defined for
that language it will search paths without language.

@return string|false
A path alias, or FALSE if no path was found.

@see \Drupal\Core\Path\AliasManagerInterface
@see \Drupal\Core\Path\AliasStorageInterface
@see \Drupal\Core\Path\AliasStorage::lookupPathAlias
Returns all aliases of Drupal system URL .