You are here

function radioactivity_get_energy in Radioactivity 6

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

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

2 calls to radioactivity_get_energy()
radioactivity_get_radioactivity_array in ./radioactivity.inc
radioactivity_rules_token_values in modules/radioactivity_rules/radioactivity_rules.module

File

./radioactivity.module, line 143

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;
}