You are here

public function DomainAliasStorage::loadByEnvironmentMatch in Domain Access 8

Loads a domain alias record by pattern lookup.

Parameters

\Drupal\domain\DomainInterface $domain: A domain entity.

string $environment: An environment string, e.g. 'default' or 'local'.

Return value

array An array of \Drupal\domain_alias\DomainAliasInterface objects.

Overrides DomainAliasStorageInterface::loadByEnvironmentMatch

File

domain_alias/src/DomainAliasStorage.php, line 109

Class

DomainAliasStorage
Alias loader utility class.

Namespace

Drupal\domain_alias

Code

public function loadByEnvironmentMatch(DomainInterface $domain, $environment) {
  $result = $this
    ->loadByProperties([
    'domain_id' => $domain
      ->id(),
    'environment' => $environment,
  ]);
  if (empty($result)) {
    return [];
  }
  return $result;
}