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()

Deprecated

Restructured API to make naming more readable and consistent. Function was deprecated in Tripal 2.0 and will be removed 2 releases from now. This function has been replaced by tripal_get_multiple_stocks().

See also

tripal_get_multiple_stocks().

File

tripal_stock/api/tripal_stock.DEPRECATED.inc, line 58
Wrapper functions to provide backwards compatibility for the tripal stock api

Code

function tripal_stock_get_all_stocks() {

  tripal_report_error(
  'tripal_deprecated', 
  TRIPAL_NOTICE, 
  "DEPRECATED: %old_function has been completely deprecated. There are often so many
     stocks in a chado database that it is unlikely a user really wants all of them.", 
  array(
    '%old_function' => 'tripal_stock_get_all_stocks'
  )
  );

  $sql = "SELECT stock_id, nid from {chado_stock}";
  $resource = db_query($sql);
  $stocks = array();
  while ($r = $resource->fetchObject()) {
    $node = node_load($r->nid);
    if ($node) {
      $stocks[$r->stock_id] = $node;
    }
  }
  return $stocks;
}