You are here

function support_client_load in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support.module \support_client_load()

Menu callback, load a client.

17 calls to support_client_load()
support_client_fetch_one_action in ./support.module
support_mail in ./support.module
Implementation of hook_mail().
support_mail_tokens in ./support.module
Return an array of token to value mappings for support e-mail messages.
support_node_access in ./support.module
Implementation of hook_node_access().
support_node_view in ./support.module
Implementation of hook_node_view().

... See full list

3 string references to 'support_client_load'
support_pm_admin_reports in support_pm/support_pm.admin.inc
support_pm_plan_overview_weekly in support_pm/support_pm.module
support_pm_theme in support_pm/support_pm.module
Implements hook_theme().

File

./support.module, line 640
support.module

Code

function support_client_load($id, $integer = TRUE) {

  // @@@ Migrate all users to entity_load()?
  static $clients = array();
  if (!isset($clients[$id])) {
    if ($integer) {
      $results = array(
        $id,
      );
    }
    else {
      $results = db_query("SELECT clid FROM {support_client} WHERE path = :path", array(
        ':path' => $id,
      ))
        ->fetchCol();
    }
    $results = entity_load('support_client', $results);
    foreach ($results as $client) {

      // @@@ Deprecate this. Entity does it better.
      drupal_alter('support_client_load', $client);
      $clients[$id] = $client;
    }
  }
  return isset($clients[$id]) ? $clients[$id] : FALSE;
}