Browse Source

Merge pull request #279 from mitchmac/6.x

Add hook_islandora_object_event to allow event listening to SOAP calls
pull/365/head
Jonathan Green 12 years ago
parent
commit
a944030c71
  1. 1
      api/fedora_item.inc
  2. 20
      fedora_repository.api.php

1
api/fedora_item.inc

@ -1475,6 +1475,7 @@ RDF;
watchdog('fedora_repository', 'Error Trying to call SOAP function "%func". Exception: @e in @f(@l)\n@t', array('%func' => $function, '@e' => $e->getMessage(), '@f' => $e->getFile(), '@l' => $e->getLine(), '@t' => $e->getTraceAsString()), NULL, WATCHDOG_ERROR); watchdog('fedora_repository', 'Error Trying to call SOAP function "%func". Exception: @e in @f(@l)\n@t', array('%func' => $function, '@e' => $e->getMessage(), '@f' => $e->getFile(), '@l' => $e->getLine(), '@t' => $e->getTraceAsString()), NULL, WATCHDOG_ERROR);
return NULL; return NULL;
} }
module_invoke_all('islandora_object_event', $function, $parameters, $result);
return $result; return $result;
} }

20
fedora_repository.api.php

@ -152,3 +152,23 @@ function hook_fedora_repository_can_ingest($collection_pid) {
function hook_fedora_repository_check_perm($op, $pid = NULL, $as_user = NULL) { function hook_fedora_repository_check_perm($op, $pid = NULL, $as_user = NULL) {
return NULL; return NULL;
} }
/**
* Implements hook_islandora_object_event().
*
* This hook allows modules to listen to most object events; anything that goes through
* Fedora_Item::soap_call will be passed to hook implementers.
*
* Implementing code should be constructed to avoid infinite loops if cascading functions.
*
* @param $function
* The SOAP function that has been called.
* @param $parameters
* The parameters sent to the SOAP call.
* @param $result
* The result of the SOAP call.
*/
function hook_islandora_object_event($function, $parameters, $result) {
// Respond to a SOAP event.
}

Loading…
Cancel
Save