You are here

function hook_sf_notifications_processed in Salesforce Suite 7.2

Hook called after a notification message has been processed.

This hook is invoked after a notification has been processed. You can use this hook to perform any additional actions required after a node has been created, updated, or deleted as a result of a Salesforce notifications message.

Parameters

$operation: The operation being performed. Either "insert", "update", or "delete".

$object_record: The object record the operation has been performed on. An array with the following keys:

  • oid: The Drupal object id of the object we are operating on. NULL if $operation is 'insert'.
  • name: The name of the fieldmap to be used.
  • drupal_entity: The entity type this object should be inserted as.
  • drupal_bundle: The bundle this object should be inserted as.
  • fields: The fields provided in the incoming Salesforce notification.
  • operation: The operation we are performing. The same as the $operation parameter.

$drupal_id: The Drupal object id of the object just inserted or updated. This parameter will not be set on the case of deletion.

2 invocations of hook_sf_notifications_processed()
sf_notifications_delete_record in sf_notifications/sf_notifications.module
Helper function for _sf_notifications_handle_message() - attempt to delete the local object data, given the salesforce object_record.
sf_notifications_update_record in sf_notifications/sf_notifications.module
Helper function for _sf_notifications_handle_message() - attempt to update (or insert if $object_record['oid'] is empty) the local object data, given the salesforce object_record.

File

sf_notifications/sf_notifications.api.php, line 79
These are the hooks that are invoked by the Salesforce Notifications module.

Code

function hook_sf_notifications_processed($operation, &$object_record) {
  switch ($operation) {
    case "insert":
    case "update":
      return TRUE;
    default:
      return FALSE;
  }
}