I was wondering what everyone is using to create custom incident emissions if they aren't using rules.
I looked through the code and ended up writing a function in a custom module which I can call when certain hooks fire or whenever else I want to energy emitted.
I based it off of the radioactivity_rules_action_emit() function that gets called through rules.

function mymodule_radioactivity_emit_energy($entity_id, $entity_type, $bundle, $field_name, $energy) {
$lang = LANGUAGE_NONE;
$profile = radioactivity_get_field_profile($entity_type, $bundle, $field_name);
if ($profile && $profile->storageObject) {
$profile->storageObject->addIncident(new RadioactivityIncident($entity_type, $bundle, $field_name, $lang, $entity_id, $energy, REQUEST_TIME));
}
}

Has anyone else tried using radioactivity this way before? Have you found it better from a performance standpoint to add an emitter to the page to send a post request to emit.php instead of calling the addIncident method directly?

Comments

Sutharsan’s picture

Status: Active » Closed (outdated)

Issue triage: Closing issue due to lack of activity.

If you believe this issue is closed in error, feel free to re-open.