function action_get_all_actions

Retrieves all action instances from the database.

This function differs from the action_list() function, which gathers actions by invoking hook_action_info(). The actions returned by this function and the actions returned by action_list() are partially synchronized. Non-configurable actions from hook_action_info() implementations are put into the database when action_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'.

1 call to action_get_all_actions()
BulkForm::views_form in drupal/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.php
Implements \Drupal\views\Plugin\views\Plugin\field\FieldPluginBase::views_form().

File

drupal/core/modules/action/action.module, line 272
This is the Actions module for executing stored actions.

Code

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