function chado_feature_load
2.x tripal_feature.chado_node.inc | chado_feature_load($nodes) |
3.x tripal_feature.chado_node.inc | chado_feature_load( |
1.x tripal_feature.module | chado_feature_load($node) |
Implements hook_load().
When a node is requested by the user this function is called to allow us to add auxiliary data to the node object.
Related topics
File
- tripal_feature/
includes/ tripal_feature.chado_node.inc, line 719 - Implementation of hooks to create a feature content type
Code
function chado_feature_load($nodes) {
foreach ($nodes as $nid => $node) {
// find the feature and add in the details
$feature_id = chado_get_id_from_nid('feature', $nid);
// if the nid does not have a matching record then skip this node.
// this can happen with orphaned nodes.
if (!$feature_id) {
continue;
}
// build the feature variable
$values = array('feature_id' => $feature_id);
$feature = chado_generate_var('feature', $values);
$nodes[$nid]->feature = $feature;
// Now get the title
$node->title = chado_get_node_title($node);
}
}