/**
  * @param BatchJob $dbBatchJob
  * @param kDistributionSubmitJobData $data
  * @param BatchJob $twinJob
  * @return BatchJob
  */
 public static function onDistributionSubmitJobPending(BatchJob $dbBatchJob, kDistributionSubmitJobData $data, BatchJob $twinJob = null)
 {
     if ($data->getProviderType() == DistributionProviderType::SYNDICATION) {
         $dbBatchJob = kJobsManager::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_FINISHED);
     }
     return $dbBatchJob;
 }
 /**
  * @param BatchJob $dbBatchJob
  * @param kDistributionSubmitJobData $data
  * @param BatchJob $twinJob
  * @return BatchJob
  */
 public static function onDistributionSubmitJobPending(BatchJob $dbBatchJob, kDistributionSubmitJobData $data, BatchJob $twinJob = null)
 {
     $entryDistribution = EntryDistributionPeer::retrieveByPK($data->getEntryDistributionId());
     if (!$entryDistribution) {
         KalturaLog::err("Entry distribution [" . $data->getEntryDistributionId() . "] not found");
         return $dbBatchJob;
     }
     $entryDistribution->setStatus(EntryDistributionStatus::SUBMITTING);
     $entryDistribution->setDirtyStatus(null);
     $entryDistribution->save();
     if ($data->getProviderType() == DistributionProviderType::SYNDICATION) {
         $dbBatchJob = kJobsManager::updateBatchJob($dbBatchJob, BatchJob::BATCHJOB_STATUS_FINISHED);
     }
     return $dbBatchJob;
 }