You are here

function hosting_get_client_by_uname in Hostmaster (Aegir) 6

Get a client by internal name.

Parameters

$uname: The internal name of this client.

See also

hosting_get_client()

1 call to hosting_get_client_by_uname()
hosting_import_client in modules/hosting/client/hosting_client.module
Helper function to generate new client node during import.

File

modules/hosting/client/hosting_client.module, line 124

Code

function hosting_get_client_by_uname($uname) {
  $result = db_result(db_query("SELECT c.nid FROM {hosting_client} c JOIN {node} n ON c.nid = n.nid WHERE c.uname = '%s' AND n.type = 'client'", $uname));
  if ($result) {
    return node_load($result);
  }
  else {
    return false;
  }
}