function actions_loop_test_watchdog

7.x actions_loop_test.module actions_loop_test_watchdog(array $log_entry)

Implements hook_watchdog().

File

drupal-7.x/modules/simpletest/tests/actions_loop_test.module, line 19

Code

function actions_loop_test_watchdog(array $log_entry) {
  // If the triggering actions are not explicitly enabled, abort.
  if (empty($_GET['trigger_actions_on_watchdog'])) {
    return;
  }
  // Get all the action ids assigned to the trigger on the watchdog hook's
  // "run" event.
  $aids = trigger_get_assigned_actions('watchdog');
  // We can pass in any applicable information in $context. There isn't much in
  // this case, but we'll pass in the hook name as the bare minimum.
  $context = array(
    'hook' => 'watchdog',
  );
  // Fire the actions on the associated object ($log_entry) and the context
  // variable.
  actions_do(array_keys($aids), $log_entry, $context);
}