function chado_project_load

2.x tripal_project.chado_node.inc chado_project_load($nodes)
3.x tripal_project.chado_node.inc chado_project_load($nodes)
1.x tripal_project.module chado_project_load($node)

Implementation of hook_load().

Parameters

$node: The node that is to have its containing information loaded

Related topics

File

tripal_project/includes/tripal_project.chado_node.inc, line 399
Implement the project node content type

Code

function chado_project_load($nodes) {

  foreach ($nodes as $nid => $node) {
    // get the feature details from chado
    $project_id = chado_get_id_from_nid('project', $node->nid);

    // if the nid does not have a matching record then skip this node.
    // this can happen with orphaned nodes.
    if (!$project_id) {
      continue;
    }


    $values = array('project_id' => $project_id);
    $project = chado_generate_var('project', $values);

    $nodes[$nid]->project = $project;

    // Now get the title
    $node->title = chado_get_node_title($node);

  }

}