- Issue created by @nod_
\Drupal\domain_unique_path_alias\DomainUniquePathAliasHelper::isExistingAlias
Load all the entities only to check if there is a match or not. We can use a count query instead.
Use a count query
/**
* Gets if the current alias exist.
*
* @return bool
* Boolean if alias exist.
*/
public function isExistingAlias(string $alias): bool {
return $this->entityTypeManager
->getStorage('path_alias')
->getQuery()
->accessCheck(FALSE)
->condition('alias', (array) $alias, 'IN')
->count()
->execute() > 0;
}
Active
1.0
Code