function tripal_stock_get_all_stocks
2.x tripal_stock.DEPRECATED.inc | tripal_stock_get_all_stocks() |
3.x tripal_stock.DEPRECATED.inc | tripal_stock_get_all_stocks() |
1.x tripal_stock.api.inc | tripal_stock_get_all_stocks() |
Purpose: Returns all stocks currently sync'd with drupal
Return value
An array of node objects keyed by stock_id
Related topics
File
- tripal_stock/
api/ tripal_stock.api.inc, line 60 - Provides an application programming interface (API) to manage stocks
Code
function tripal_stock_get_all_stocks() {
$sql = "SELECT stock_id, nid from {chado_stock}";
$resource = db_query($sql);
$stocks = array();
while ($r = db_fetch_object($resource)) {
$node = node_load($r->nid);
if ($node) {
$stocks[$r->stock_id] = $node;
}
}
return $stocks;
}