You are here

function trigger_get_assigned_actions in Drupal 7

Gets the action IDs of actions to be executed for a hook.

Parameters

$hook: The name of the hook being fired.

Return value

An array whose keys are action IDs that the user has associated with this trigger, and whose values are arrays containing the action type and label.

9 calls to trigger_get_assigned_actions()
actions_loop_test_watchdog in modules/simpletest/tests/actions_loop_test.module
Implements hook_watchdog().
TriggerActionTestCase::assignSimpleAction in modules/trigger/trigger.test
Assigns a simple (non-configurable) action to a trigger.
TriggerOtherTestCase::testActionsUser in modules/trigger/trigger.test
Tests triggering on user create and user login.
trigger_assign_form in modules/trigger/trigger.admin.inc
Returns the form for assigning an action to a trigger.
trigger_cron in modules/trigger/trigger.module
Implements hook_cron().

... See full list

4 string references to 'trigger_get_assigned_actions'
TriggerActionTestCase::assignSystemEmailAction in modules/trigger/trigger.test
Assigns a system_send_email_action to the passed-in trigger.
trigger_actions_delete in modules/trigger/trigger.module
Implements hook_actions_delete().
trigger_assign_form_submit in modules/trigger/trigger.admin.inc
Form submission handler for trigger_assign_form().
trigger_unassign_submit in modules/trigger/trigger.admin.inc
Form submission handler for trigger_unassign().

File

modules/trigger/trigger.module, line 188
Enables functions to be stored and executed at a later time.

Code

function trigger_get_assigned_actions($hook) {
  $actions =& drupal_static(__FUNCTION__, array());
  if (!isset($actions[$hook])) {
    $actions[$hook] = db_query("SELECT ta.aid, a.type, a.label FROM {trigger_assignments} ta LEFT JOIN {actions} a ON ta.aid = a.aid WHERE ta.hook = :hook ORDER BY ta.weight", array(
      ':hook' => $hook,
    ))
      ->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
  }
  return $actions[$hook];
}