You are here

public function DomainStorage::loadOptionsList in Domain Access 8

Returns the list of domains formatted for a form options list.

Return value

array A weight-sorted array of id => label for use in forms.

Overrides DomainStorageInterface::loadOptionsList

File

domain/src/DomainStorage.php, line 117

Class

DomainStorage
Loads Domain records.

Namespace

Drupal\domain

Code

public function loadOptionsList() {
  $list = [];
  foreach ($this
    ->loadMultipleSorted() as $id => $domain) {
    $list[$id] = $domain
      ->label();
  }
  return $list;
}