function radioactivity_rules_action_set in Radioactivity 7.2
Action: Set energy
1 string reference to 'radioactivity_rules_action_set'
- radioactivity_rules_action_info in ./
radioactivity.rules.inc - Implements hook_rules_action_info().
File
- ./
radioactivity.rules.inc, line 171
Code
function radioactivity_rules_action_set($field, $energy) {
$info = $field
->info();
$field_name = $info['name'];
$entity_type = $info['parent']
->type();
$bundle = $info['parent']
->getBundle();
$id = $info['parent']
->getIdentifier();
$lang = LANGUAGE_NONE;
if ($info['translatable']) {
global $language;
$lang = $language->language;
}
_radioactivity_update_energy($entity_type, $id, $field_name, $lang, $energy, time(), TRUE);
}