function AliasRepositoryInterface::lookupByAlias

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

Searches a path alias for a given alias.

The default implementation performs case-insensitive matching on the 'path' and 'alias' strings.

Parameters

string $alias: The alias to investigate for corresponding system paths.

string $langcode: Language code to search the alias with. If there's no alias defined for that language it will search aliases without language.

Return value

array|null An array containing the 'id', 'path', 'alias' and 'langcode' properties of a path alias, or NULL if none was found.

1 method overrides AliasRepositoryInterface::lookupByAlias()
AliasRepository::lookupByAlias in core/modules/path_alias/src/AliasRepository.php
Searches a path alias for a given alias.

File

core/modules/path_alias/src/AliasRepositoryInterface.php, line 68

Class

AliasRepositoryInterface
Provides an interface for path alias lookup operations.

Namespace

Drupal\path_alias

Code

public function lookupByAlias($alias, $langcode);

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