You are here

function hosting_get_client_by_uname in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 client/hosting_client.module \hosting_get_client_by_uname()
  2. 7.3 client/hosting_client.module \hosting_get_client_by_uname()

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 client/hosting_client.module
Helper function to generate new client node during import.

File

client/hosting_client.module, line 135

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;
  }
}