You are here

public function MongodbPathAliasStorage::pathHasMatchingAlias in MongoDB 8

Check if any alias exists starting with $initial_substring.

Parameters

string $initial_substring: Initial path substring to test against.

Return value

bool TRUE if any alias exists, FALSE otherwise.

Overrides AliasStorageInterface::pathHasMatchingAlias

File

src/MongodbPathAliasStorage.php, line 151
Contains Drupal\mongodb\Path.

Class

MongodbPathAliasStorage
Provides a class for CRUD operations on path aliases in MongoDB.

Namespace

Drupal\mongodb

Code

public function pathHasMatchingAlias($path_prefix) {
  $args['source']['$regex'] = new \MongoRegex('/^' . preg_quote($path_prefix, '/') . '/');
  return (bool) $this
    ->mongodbAliasQuery($args, NULL, 1);
}