You are here

function hosting_get_client_by_email in Hostmaster (Aegir) 6

Get a client by email

This is really a shortcut to node_load()

Deprecated

the email field and therefore this function will be completely dropped in 2.x. this may not even work at all as the email field will not be populated on new sites. use hosting_get_client() instead

See also

node_load()

hosting_get_client()

1 call to hosting_get_client_by_email()
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 146

Code

function hosting_get_client_by_email($email) {
  $caller = next(debug_backtrace());
  trigger_error(t("@function() is deprecated and may yield undefined results, replace with @newfunction(), called from @caller in @file", array(
    '@file' => $caller['file'] . ':' . $caller['line'],
    '@caller' => $caller['function'],
    '@function' => __FUNCTION__,
    '@newfunction' => 'hosting_get_client',
  )), E_USER_DEPRECATED);
  $result = db_result(db_query("SELECT c.nid FROM {hosting_client} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.email = '%s'", $email));
  if ($result) {
    return node_load($result);
  }
  return false;
}