You are here

function radioactivity_get_energy in Radioactivity 5

Same name and namespace in other branches
  1. 6 radioactivity.module \radioactivity_get_energy()

Reads energies for a node. Returns array of $dpid => $energy

1 call to radioactivity_get_energy()
radioactivity_get_radioactivity_array in ./radioactivity.module
1 string reference to 'radioactivity_get_energy'
radioactivity_http_port_edit in plugins/radioactivity_http.module

File

./radioactivity.module, line 490

Code

function radioactivity_get_energy($oid, $oclass) {
  $ret = array();

  // remap id if necessary
  $oid = _radioactivity_possibly_remap_id($oid, $oclass);
  $result = db_query("SELECT decay_profile, energy FROM {radioactivity} WHERE id=%d AND class='%s'", $oid, $oclass);
  while ($row = db_fetch_object($result)) {
    $ret[$row->decay_profile] = $row->energy;
  }
  return $ret;
}