/**
  * batch addBatchJob action allows to add a generic BatchJob 
  * 
  * @action addBatchJob
  * @param KalturaBatchJob $batchJob  
  * @return KalturaBatchJob 
  */
 function addBatchJobAction(KalturaBatchJob $batchJob)
 {
     kJobsManager::addJob($batchJob->toObject(), $batchJob->data, $batchJob->jobType, $batchJob->jobSubType);
 }
 /**
  * batch updateExclusiveJobAction action updates a BatchJob of extended type that was claimed using the getExclusiveJobs
  * 
  * @action updateExclusiveJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }
 private function updateJob(KalturaBatchJob $job)
 {
     $dbJob = BatchJobPeer::retrieveByPK($job->id);
     $dbJob = $job->toObject($dbJob);
     $dbJob->save();
 }