LogLibJob->setConfigs( array( 'dbExecuteUser' => get_class($this), 'requestId' => 'LRT' ) ); // Loads LongRunTaskLib library $this->load->library('LongRunTaskLib'); $this->_jobid = null; // default value } /** * Destructor, once the LRT execution is over... */ public function __destruct() { // Check if the property has been set if ($this->_jobid == null) { $this->logError( 'The method '.get_class($this).'->run must assign the value of the jobid parameter to the property _jobid at the very beginning: $this->_jobid = $jobid;' ); } else // If set then { // Set the status of this LRT as done $setStatusResult = $this->longruntasklib->setStatus($this->_jobid, LongRunTaskLib::STATUS_DONE); // If an error occurred then log it if (isError($setStatusResult)) $this->logError($setStatusResult); } } //------------------------------------------------------------------------------------------------------------------ // Public methods abstract public function run($jobid); //------------------------------------------------------------------------------------------------------------------ // Protected methods /** * */ protected function getLrt($jobid) { return $this->longruntasklib->getLrt($jobid); } /** * */ protected function setProgress($jobid, $progress) { return $this->longruntasklib->setProgress($jobid, $progress); } /** * */ protected function setOutput($jobid, $output) { return $this->longruntasklib->setOutuput($jobid, $output); } }