_trigger_get_hook_aids

Versions
6
_trigger_get_hook_aids($hook, $op = '')

Get the aids of actions to be executed for a hook-op combination.

Parameters

$hook The name of the hook being fired.

$op The name of the operation being executed. Defaults to an empty string because some hooks (e.g., hook_cron()) do not have operations.

Return value

An array of action IDs.

▾ 5 functions call _trigger_get_hook_aids()

trigger_comment in modules/trigger/trigger.module
Implementation of hook_comment().
trigger_cron in modules/trigger/trigger.module
Implementation of hook_cron().
trigger_nodeapi in modules/trigger/trigger.module
Implementation of hook_nodeapi().
trigger_taxonomy in modules/trigger/trigger.module
Implementation of hook_taxonomy().
trigger_user in modules/trigger/trigger.module
Implementation of hook_user().

Code

modules/trigger/trigger.module, line 143

<?php
function _trigger_get_hook_aids($hook, $op = '') {
  $aids = array();
  $result = db_query("SELECT aa.aid, a.type FROM {trigger_assignments} aa LEFT JOIN {actions} a ON aa.aid = a.aid WHERE aa.hook = '%s' AND aa.op = '%s' ORDER BY weight", $hook, $op);
  while ($action = db_fetch_object($result)) {
    $aids[$action->aid]['type'] = $action->type;
  }
  return $aids;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.