Example #1
0
 /**
  * The function fills the batch job log to contain all the information the
  * current batch job contains in it.
  */
 public function copyIntoBatchLog(BatchJobLog $copyObj)
 {
     // Batch Job Fields
     $copyObj->setJobType($this->job_type);
     $copyObj->setJobSubType($this->job_sub_type);
     $copyObj->setData($this->data);
     $copyObj->setStatus($this->status);
     $copyObj->setAbort($this->execution_status == BatchJobExecutionStatus::ABORTED);
     $copyObj->setMessage($this->message);
     $copyObj->setDescription($this->description);
     $copyObj->setCreatedAt($this->created_at);
     $copyObj->setUpdatedAt($this->updated_at);
     $copyObj->setPriority($this->priority);
     $copyObj->setQueueTime($this->queue_time);
     $copyObj->setFinishTime($this->finish_time);
     $copyObj->setEntryId($this->entry_id);
     $copyObj->setPartnerId($this->partner_id);
     $copyObj->setLastSchedulerId($this->last_scheduler_id);
     $copyObj->setLastWorkerId($this->last_worker_id);
     $copyObj->setBulkJobId($this->bulk_job_id);
     $copyObj->setRootJobId($this->root_job_id);
     $copyObj->setParentJobId($this->parent_job_id);
     $copyObj->setDc($this->dc);
     $copyObj->setErrType($this->err_type);
     $copyObj->setErrNumber($this->err_number);
     // Batch job lock info
     if ($this->getLockInfo() != null) {
         $copyObj->setFileSize($this->getLockInfo()->getEstimatedEffort());
         $copyObj->setLockVersion($this->getLockInfo()->getLockVersion());
     }
     // Batch job lock fields
     $dbBatchJobLock = $this->getBatchJobLock();
     if ($dbBatchJobLock !== null) {
         $copyObj->setProcessorExpiration($dbBatchJobLock->getExpiration());
         $copyObj->setExecutionAttempts($dbBatchJobLock->getExecutionAttempts());
         $copyObj->setCheckAgainTimeout($dbBatchJobLock->getStartAt());
         $copyObj->setSchedulerId($dbBatchJobLock->getSchedulerId());
         $copyObj->setWorkerId($dbBatchJobLock->getWorkerId());
         $copyObj->setBatchIndex($dbBatchJobLock->getBatchIndex());
     }
     $copyObj->setNew(true);
     $copyObj->setId(NULL);
     // this is a auto-increment column, so set to default value
 }