diff --git a/api/fedora_item.inc b/api/fedora_item.inc index 0443548d..6566dd08 100644 --- a/api/fedora_item.inc +++ b/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); return NULL; } + module_invoke_all('islandora_object_event', $function, $parameters, $result); return $result; } diff --git a/fedora_repository.api.php b/fedora_repository.api.php index a37758a4..5a67174d 100644 --- a/fedora_repository.api.php +++ b/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) { 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. +} +