Browse Source

Add hook_islandora_object_event to allow event listening to SOAP calls

pull/279/head
mitchmac 12 years ago
parent
commit
2a0b6ea058
  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);
return NULL;
}
module_invoke_all('islandora_object_event', $function, $parameters, $result);
return $result;
}

20
fedora_repository.api.php

@ -146,3 +146,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.
}

Loading…
Cancel
Save