You are here

function hook_domain_load in Domain Access 8

Same name and namespace in other branches
  1. 7.3 domain.api.php \hook_domain_load()

Notifies other modules that we are loading a domain record from the database.

When using this hook, you should invoke the namespace with:

use Drupal\domain\DomainInterface;

Parameters

\Drupal\domain\DomainInterface[] $domains: An array of $domain record objects.

2 functions implement hook_domain_load()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

domain_alias_domain_load in domain_alias/domain_alias.module
Implements hook_ENTITY_TYPE_load().
domain_test_domain_load in domain/tests/modules/domain_test/domain_test.module
Implements hook_domain_load().

File

domain/domain.api.php, line 18
API documentation file for Domain module.

Code

function hook_domain_load(array $domains) {

  // Add a variable to the $domain.
  foreach ($domains as $domain) {
    $domain
      ->addProperty('myvar', 'mydomainvar');
  }
}