function rules_events_entity_unchanged in Rules 7.2
Gets an unchanged entity that doesn't contain any recent changes.
This handler assumes the name of the variable for the changed entity is the same as for the unchanged entity but without the trailing "_unchanged"; e.g., for the "node_unchanged" variable the handler assumes there is a "node" variable.
Related topics
4 string references to 'rules_events_entity_unchanged'
- rules_comment_event_info in modules/
comment.rules.inc - Implements hook_rules_event_info().
- rules_events_node_variables in modules/
node.rules.inc - Returns some parameter suitable for using it with a node.
- rules_taxonomy_event_info in modules/
taxonomy.rules.inc - Implements hook_rules_event_info().
- rules_user_event_info in modules/
user.rules.inc - Implements hook_rules_event_info().
File
- modules/
events.inc, line 23 - Invokes events on behalf core modules.
Code
function rules_events_entity_unchanged($arguments, $name, $info) {
// Cut of the trailing _unchanged.
$var_name = substr($name, 0, -10);
$entity = $arguments[$var_name];
if (isset($entity->original)) {
return $entity->original;
}
}