You are here

public function AliasStorageHelper::loadBySourcePrefix in Pathauto 8

Fetches an existing URL alias given a path prefix.

Parameters

string $source: An internal Drupal path prefix.

Return value

integer[] An array of PIDs.

Overrides AliasStorageHelperInterface::loadBySourcePrefix

1 call to AliasStorageHelper::loadBySourcePrefix()
AliasStorageHelper::deleteBySourcePrefix in src/AliasStorageHelper.php
Delete all aliases by source url.

File

src/AliasStorageHelper.php, line 211

Class

AliasStorageHelper
Provides helper methods for accessing alias storage.

Namespace

Drupal\pathauto

Code

public function loadBySourcePrefix($source) {
  return $this->entityTypeManager
    ->getStorage('path_alias')
    ->getQuery('OR')
    ->condition('path', $source, '=')
    ->condition('path', rtrim($source, '/') . '/', 'STARTS_WITH')
    ->execute();
}