function actions_get_all_actions

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'.

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!actions.inc/function/actions_get_all_actions/7.x