* Class constructor.
*/
public function __construct() {
- $config = CRM_Core_Config::singleton();
- $config->fatalErrorHandler = 'CRM_Core_JobManager_scheduledJobFatalErrorHandler';
-
$this->jobs = $this->_getJobs();
}
$statusPref = [
'name' => 'checkLastCron',
'check_info' => gmdate('U'),
+ 'prefs' => '',
];
CRM_Core_BAO_StatusPreference::create($statusPref);
}
*/
private function _getJob($id = NULL, $entity = NULL, $action = NULL) {
if (is_null($id) && is_null($action)) {
- CRM_Core_Error::fatal('You need to provide either id or name to use this method');
+ throw new CRM_Core_Exception('You need to provide either id or name to use this method');
}
$dao = new CRM_Core_DAO_Job();
$dao->id = $id;
}
}
-
-/**
- * @param $message
- *
- * @throws Exception
- */
-function CRM_Core_JobManager_scheduledJobFatalErrorHandler($message) {
- throw new Exception("{$message['message']}: {$message['code']}");
-}