You are here

function actions_get_all_actions in Drupal 7

Same name and namespace in other branches
  1. 6 includes/actions.inc \actions_get_all_actions()

Retrieves all action instances from the database.

This function differs from the actions_list() function, which gathers actions by invoking hook_action_info(). The actions returned by this function and the actions returned by actions_list() are partially synchronized. Non-configurable actions from hook_action_info() implementations are put into the database when actions_synchronize() is called, which happens when admin/config/system/actions is visited. Configurable actions are not added to the database until they are configured in the user interface, in which case a database row is created for each configuration of each action.

Return value

Associative array keyed by numeric action ID. Each value is an associative array with keys 'callback', 'label', 'type' and 'configurable'.

3 calls to actions_get_all_actions()
trigger_assign_form in modules/trigger/trigger.admin.inc
Returns the form for assigning an action to a trigger.
trigger_unassign in modules/trigger/trigger.admin.inc
Form constructor for confirmation page for removal of an assigned action.
trigger_unassign_submit in modules/trigger/trigger.admin.inc
Form submission handler for trigger_unassign().

File

includes/actions.inc, line 190
This is the actions engine for executing stored actions.

Code

function actions_get_all_actions() {
  $actions = db_query("SELECT aid, type, callback, parameters, label FROM {actions}")
    ->fetchAllAssoc('aid', PDO::FETCH_ASSOC);
  foreach ($actions as &$action) {
    $action['configurable'] = (bool) $action['parameters'];
    unset($action['parameters']);
    unset($action['aid']);
  }
  return $actions;
}