You are here

protected function DomainCommands::validateDomain in Domain Access 8

Validates a domain meets the standards for a hostname.

Parameters

\Drupal\domain\DomainInterface $domain: The domain to validate for syntax and uniqueness.

Return value

string[] Array of strings indicating issues found.

See also

domain_validate()

1 call to DomainCommands::validateDomain()
DomainCommands::add in domain/src/Commands/DomainCommands.php
Add a new domain to the site.

File

domain/src/Commands/DomainCommands.php, line 1137

Class

DomainCommands
Drush commands for the domain module.

Namespace

Drupal\domain\Commands

Code

protected function validateDomain(DomainInterface $domain) {

  /** @var \Drupal\domain\DomainValidatorInterface $validator */
  $validator = \Drupal::service('domain.validator');
  return $validator
    ->validate($domain
    ->getHostname());
}