You are here

function domain_machine_name_load in Domain Access 7.3

Loads a domain from its machine name.

Parameters

$machine_name: The machine name of the domain record.

$full: Boolean indicator to run hook_domain_load() or not.

Return value

A Domain array or -1 on failure.

8 calls to domain_machine_name_load()
DomainCreateTest::testDomainMacineNameLoad in tests/domain.test
DomainNodeHandler::prepare in ./domain.migrate.inc
DomainUserHandler::prepare in ./domain.migrate.inc
domain_features_export_render in ./domain.features.inc
Implements hook_features_export_render().
domain_features_selection in ./domain.module
Processes export data selections consistently.

... See full list

File

./domain.module, line 3758
Core module functions for the Domain Access suite.

Code

function domain_machine_name_load($machine_name, $full = FALSE) {
  $domain = db_query('SELECT domain_id, subdomain, sitename, scheme, valid, weight, is_default, machine_name FROM {domain} WHERE machine_name = :machine_name', array(
    ':machine_name' => $machine_name,
  ))
    ->fetchAssoc();
  if ($full && !empty($domain)) {
    $domain = domain_api($domain, TRUE);
  }
  return $domain;
}