/** * @param string $global_error_callback Class name of global error callback implemented from IErrorCallback * @throws Exceptions\TaskPerformerException * @return $this */ public function set_global_error_callback($global_error_callback = null) { if (is_null($global_error_callback) || !Helper::check_class($global_error_callback, TaskConst::GLOBAL_ERROR_CALLBACK)) { throw new TaskPerformerException('Global callback class not found'); } $this->global_error_callback = $global_error_callback; return $this; }
public function check_callback_class_names() { $check_classes_list = array(TaskConst::JOB => $this->get_task_name(), TaskConst::TASK_CALLBACK => $this->get_callback(), TaskConst::TASK_ERROR_CALLBACK => $this->get_error_callback(), TaskConst::PARENT_CALLBACK => $this->get_parent_callback(), TaskConst::PARENT_ERROR_CALLBACK => $this->get_parent_error_callback()); $classes_found = true; foreach ($check_classes_list as $job_id => $class_name) { if (is_null($class_name)) { continue; } if (!Helper::check_class($class_name, $job_id)) { $classes_found = false; $this->response()->set_error("Not found class " . $class_name . " for " . TaskConst::$job_name_by_id[$job_id]); } } return $classes_found; }