function action_loop_test_watchdog

Implements hook_watchdog().

File

drupal/core/modules/action/tests/action_loop_test/action_loop_test.module, line 6

Code

function action_loop_test_watchdog(array $log_entry) {

  // If the triggering actions are not explicitly enabled, abort.
  if (empty($_GET['trigger_action_on_watchdog'])) {
    return;
  }

  // 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.
  $aids = (array) $_GET['trigger_action_on_watchdog'];
  actions_do($aids, $log_entry, $context);
}