You are here

function action_example_basic_action in Examples for Developers 7

Action function for action_example_basic_action.

This action is not expecting any type of entity object, and can be used with any trigger type or any event.

Parameters

object $entity: An optional entity object.

array $context: Array with parameters for this action: depends on the trigger.

See also

action_example_action_info()

Related topics

1 string reference to 'action_example_basic_action'
ActionExampleTestCase::testActionExample in action_example/action_example.test
Test Action Example.

File

action_example/action_example.module, line 204
Action definition example module.

Code

function action_example_basic_action(&$entity, $context = array()) {

  // In this case we are ignoring the entity and the context. This case of
  // action is useful when your action does not depend on the context, and
  // the function must do something regardless the scope of the trigger.
  // Simply announces that the action was executed using a message.
  drupal_set_message(t('action_example_basic_action fired'));
  watchdog('action_example', 'action_example_basic_action fired.');
}