You are here

function _data_node_get_title in Data 6

Static cache node titles to avoid unnecessary node loading.

3 calls to _data_node_get_title()
data_node_render_add_link in data_node/data_node.module
Render an add link for a given item..
data_node_render_labels in data_node/data_node.module
Render node-data labels for a given item.
data_node_render_remove_link in data_node/data_node.module
Render a remove link for a given item.

File

data_node/data_node.module, line 375
Hooks and API functions for Data Node module.

Code

function _data_node_get_title($nid) {
  static $nodes = array();
  if (!isset($nodes[$nid])) {
    $nodes[$nid] = check_plain(db_result(db_query("SELECT title FROM {node} WHERE nid = %d", $nid)));
  }
  return isset($nodes[$nid]) ? $nodes[$nid] : NULL;
}