function actions_save

cis7 actions.inc actions_save($function, $type, $params, $label, $aid = NULL)
cle7 actions.inc actions_save($function, $type, $params, $label, $aid = NULL)
elmsmedia7 actions.inc actions_save($function, $type, $params, $label, $aid = NULL)
icor7 actions.inc actions_save($function, $type, $params, $label, $aid = NULL)
meedjum_blog7 actions.inc actions_save($function, $type, $params, $label, $aid = NULL)
mooc7 actions.inc actions_save($function, $type, $params, $label, $aid = NULL)

Saves an action and its user-supplied parameter values to the database.

Parameters

$function: The name of the function to be called when this action is performed.

$type: The type of action, to describe grouping and/or context, e.g., 'node', 'user', 'comment', or 'system'.

$params: An associative array with parameter names as keys and parameter values as values.

$label: A user-supplied label of this particular action, e.g., 'Send e-mail to Jim'.

$aid: The ID of this action. If omitted, a new action is created.

Return value

The ID of the action.

1 call to actions_save()
system_actions_configure_submit in modules/system/system.admin.inc
Process system_actions_configure() form submissions.

File

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

Code

function actions_save($function, $type, $params, $label, $aid = NULL) {
  // aid is the callback for singleton actions so we need to keep a separate
  // table for numeric aids.
  if (!$aid) {
    $aid = db_next_id();
  }

  db_merge('actions')->key(array('aid' => $aid))->fields(array(
    'callback' => $function,
    'type' => $type,
    'parameters' => serialize($params),
    'label' => $label,
  ))->execute();

  watchdog('actions', 'Action %action saved.', array('%action' => $label));
  return $aid;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.