You are here

public function DomainStorage::loadDefaultDomain in Domain Access 8

Gets the default domain object.

Return value

\Drupal\domain\DomainInterface|null The default domain record or NULL.

Overrides DomainStorageInterface::loadDefaultDomain

1 call to DomainStorage::loadDefaultDomain()
DomainStorage::loadDefaultId in domain/src/DomainStorage.php
Returns the id of the default domain.

File

domain/src/DomainStorage.php, line 85

Class

DomainStorage
Loads Domain records.

Namespace

Drupal\domain

Code

public function loadDefaultDomain() {
  $result = $this
    ->loadByProperties([
    'is_default' => TRUE,
  ]);
  if (!empty($result)) {
    return current($result);
  }
  return NULL;
}