function chado_pub_load

2.x tripal_pub.chado_node.inc chado_pub_load($nodes)
3.x tripal_pub.chado_node.inc chado_pub_load($nodes)
1.x tripal_pub.module chado_pub_load($node)

Implementation of tripal_pub_load().

Parameters

$node: The node that is to be accessed from the database

Return value

$node The node with the information to be loaded into the database

File

tripal_pub/tripal_pub.module, line 705
The Tripal Publication module allows you to search the PubMed databse for academic articles, that relate to user specified tpoic\s. As well, it allows management of publications so that a user can enter specified details regarding a desired…

Code

function chado_pub_load($node) {
  // get the feature details from chado
  $pub_id = chado_get_id_for_node('pub', $node);

  $values = array('pub_id' => $pub_id);
  $pub = tripal_core_generate_chado_var('pub', $values);

  // expand the 'text' fields as those aren't included by default
  // and they really shouldn't be so large to cause problems
  if (is_array($pub) or is_object($pub)) {
    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.title');
    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.volumetitle');
    $pub = tripal_core_expand_chado_vars($pub, 'field', 'pub.uniquename');
  }

  // set the URL path
  $path = "pub/$pub_id";

  $additions = new stdClass();
  $additions->pub = $pub;
  return $additions;

}