function AliasRepository::pathHasMatchingAlias

Same name and namespace in other branches
  1. 11.x core/modules/path_alias/src/AliasRepository.php \Drupal\path_alias\AliasRepository::pathHasMatchingAlias()

File

core/modules/path_alias/src/AliasRepository.php, line 91

Class

AliasRepository
Provides the default path alias lookup operations.

Namespace

Drupal\path_alias

Code

public function pathHasMatchingAlias($initial_substring) {
  $query = $this->getBaseQuery();
  $query->addExpression(1);
  return (bool) $query->condition('base_table.path', $this->connection
    ->escapeLike($initial_substring) . '%', 'LIKE')
    ->range(0, 1)
    ->execute()
    ->fetchField();
}

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