You are here

function patron_load_by_uid in Library 6

Same name and namespace in other branches
  1. 5.2 patron/patron.module \patron_load_by_uid()
5 calls to patron_load_by_uid()
library_action_access in ./library.module
library_get_action_links in ./library.module
library_history_access in ./library.module
library_transaction_form in ./library.pages.inc
@file Functions for generating page displays related to the library module
patron_user in patron/patron.module
Implementation of hook_user().

File

patron/patron.module, line 565

Code

function patron_load_by_uid($uid) {
  if (variable_get('patron_is_user', PATRON_NOT_USER) == PATRON_USER && is_numeric($uid)) {
    $nid = db_result(db_query_range("SELECT nid FROM {library_patrons} WHERE patron_uid = %d", $uid, 0, 1));
    if ($nid) {
      $node = node_load($nid);
      return $node;
    }
  }
  return '';
}