actions_get_all_actions

Definition

actions_get_all_actions()
drupal/includes/actions.inc, line 179

Description

Retrieve all action instances from the database.

Compare with actions_list() which gathers actions by invoking hook_action_info(). The two are synchronized by visiting /admin/build/actions (when actions.module is enabled) which runs actions_synchronize().

Return value

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

Code

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