Drupal7: functions and hooks related to core Trigger and actions for system events

Keywords

There are some remarks on core Trigger vs Rules under the Rules module review page.


It's worth examining the docs for actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a2 = NULL):

Performs a given list of actions by executing their callback functions.

Given the IDs of actions to perform, this function finds out what the callback functions for the actions are by querying the database. Then it calls each callback using the function call $function($object, $context, $a1, $a2), passing the input arguments of this function (see below) to the action function.

Parameters

$action_ids: The IDs of the actions to perform. Can be a single action ID or an array of IDs. IDs of configurable actions must be given as numeric action IDs; IDs of non-configurable actions may be given as action function names.

$object: The object that the action will act on: a node, user, or comment object.

$context: Associative array containing extra information about what triggered the action call, with $context['hook'] giving the name of the hook that resulted in this call to actions_do().

$a1: Passed along to the callback.

$a2: Passed along to the callback.

Return value

An associative array containing the results of the functions that perform the actions, keyed on action ID.

Visit also