X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FHook.php;h=4a443495853394ead2bfa05c2b90e7b6c293e901;hb=912d0751110824a9ad828629d56aa942b41f9d73;hp=12e595fb5cce795ecf5424be3cb4fcc565685269;hpb=4103cb79166a87f4fd167cf0f570f248d8cf2732;p=civicrm-core.git diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 12e595fb5c..4a44349585 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -2396,4 +2396,36 @@ abstract class CRM_Utils_Hook { ); } + /** + * This hook is called before a scheduled job is executed + * + * @param CRM_Core_DAO_Job $job + * The job to be executed + * @param array $params + * The arguments to be given to the job + */ + public static function preJob($job, $params) { + return self::singleton()->invoke(array('job', 'params'), $job, $params, + self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_preJob' + ); + } + + /** + * This hook is called after a scheduled job is executed + * + * @param CRM_Core_DAO_Job $job + * The job that was executed + * @param array $params + * The arguments given to the job + * @param array $result + * The result of the API call, or the thrown exception if any + */ + public static function postJob($job, $params, $result) { + return self::singleton()->invoke(array('job', 'params', 'result'), $job, $params, $result, + self::$_nullObject, self::$_nullObject, self::$_nullObject, + 'civicrm_postJob' + ); + } + }