You are here

function _radioactivity_resolve_classname in Radioactivity 6

Same name and namespace in other branches
  1. 5 radioactivity.inc \_radioactivity_resolve_classname()

Resolve full class name for a specific object. This utilizes subclass resolver if defined.

1 call to _radioactivity_resolve_classname()
radioactivity_get_energies_for_source in ./radioactivity.inc
Return energies for source action.

File

./radioactivity.inc, line 71

Code

function _radioactivity_resolve_classname($oid, $oclass) {
  static $map = array();
  if (!isset($map[$oclass][$oid])) {
    $info = radioactivity_get_radioactivity_info();
    $function = $info['targets'][$oclass]['subclass_resolver'];
    if ($function) {
      $subclass = $function($oid, $oclass);
      if ($subclass) {
        $classname = $oclass . ':' . $subclass;
      }
      else {
        $classname = $oclass;
      }
    }
    else {
      $classname = $oclass;
    }
    $map[$oclass][$oid] = $classname;
  }
  return $map[$oclass][$oid];
}