You are here

function hosting_get_client in Hosting 7.4

Same name and namespace in other branches
  1. 5 client/hosting_client.module \hosting_get_client()
  2. 6.2 client/hosting_client.module \hosting_get_client()
  3. 7.3 client/hosting_client.module \hosting_get_client()

Get a client by name or nid.

Parameters

int|object $client: Either the nid or the client title

Return value

bool|object The client node object of FALSE.

11 calls to hosting_get_client()
hook_hosting_quota_get_usage in quota/hosting_quota.api.php
Definition of hook_hosting_quota_get_usage
hosting_client_platform_access_form in client/hosting_client.module
Page callback for the client platform access form.
hosting_client_platform_access_form_submit in client/hosting_client.module
Submit handler for the client platform access form.
hosting_client_user_form_submit in client/hosting_client.access.inc
Save the values submitted when editing or adding a user.
hosting_client_user_form_validate in client/hosting_client.access.inc
Validate the submission of a user form.

... See full list

File

client/hosting_client.module, line 149

Code

function hosting_get_client($client) {
  if (is_numeric($client)) {

    // @todo: confirm that we validate against numeric client names.
    return node_load($client);
  }
  else {
    if ($nodes = entity_load('node', FALSE, array(
      'type' => 'client',
      'title' => $client,
    ))) {
      return array_shift($nodes);
    }
    else {
      return FALSE;
    }
  }
}