You are here

public function DomainAliasStorage::loadByPattern in Domain Access 8

Loads a domain alias record by pattern lookup.

Parameters

string $pattern: A pattern string, in the format *.example.com.

Return value

\Drupal\domain_alias\DomainAliasInterface|null The domain alias record given a pattern string.

Overrides DomainAliasStorageInterface::loadByPattern

1 call to DomainAliasStorage::loadByPattern()
DomainAliasStorage::loadByHostname in domain_alias/src/DomainAliasStorage.php
Loads a domain alias record by hostname lookup.

File

domain_alias/src/DomainAliasStorage.php, line 87

Class

DomainAliasStorage
Alias loader utility class.

Namespace

Drupal\domain_alias

Code

public function loadByPattern($pattern) {
  $result = $this
    ->loadByProperties([
    'pattern' => $pattern,
  ]);
  if (empty($result)) {
    return NULL;
  }
  return current($result);
}