/**
  * @param BatchJob $dbBatchJob
  * @param kDistributionFetchReportJobData $data
  * @param BatchJob $twinJob
  * @return BatchJob
  */
 public static function onDistributionFetchReportJobFinished(BatchJob $dbBatchJob, kDistributionFetchReportJobData $data, BatchJob $twinJob = null)
 {
     $entryDistribution = EntryDistributionPeer::retrieveByPK($data->getEntryDistributionId());
     if (!$entryDistribution) {
         KalturaLog::err("Entry distribution [" . $data->getEntryDistributionId() . "] not found");
         return $dbBatchJob;
     }
     $providerData = $data->getProviderData();
     /*		if($providerData instanceof kIdeticDistributionJobProviderData)
     		{
     			$entryDistribution->putInCustomData('emailed', $providerData->getEmailed());
     			$entryDistribution->putInCustomData('rated', $providerData->getRated());
     			$entryDistribution->putInCustomData('blogged', $providerData->getBlogged());
     			$entryDistribution->putInCustomData('reviewed', $providerData->getReviewed());
     			$entryDistribution->putInCustomData('bookmarked', $providerData->getBookmarked());
     			$entryDistribution->putInCustomData('playbackFailed', $providerData->getPlaybackFailed());
     			$entryDistribution->putInCustomData('timeSpent', $providerData->getTimeSpent());
     			$entryDistribution->putInCustomData('recommended', $providerData->getRecommended());
     			
     			$entryDistribution->save();
     		}
     	*/
     return $dbBatchJob;
 }
 /**
  * @param EntryDistribution $entryDistribution
  * @param DistributionProfile $distributionProfile
  * @return BatchJob
  */
 protected static function addFetchReportJob(EntryDistribution $entryDistribution, DistributionProfile $distributionProfile)
 {
     $jobData = new kDistributionFetchReportJobData();
     $jobData->setDistributionProfileId($entryDistribution->getDistributionProfileId());
     $jobData->setEntryDistributionId($entryDistribution->getId());
     $jobData->setProviderType($distributionProfile->getProviderType());
     $jobData->setRemoteId($entryDistribution->getRemoteId());
     $batchJob = new BatchJob();
     $batchJob->setEntryId($entryDistribution->getEntryId());
     $batchJob->setPartnerId($entryDistribution->getPartnerId());
     $jobType = ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_FETCH_REPORT);
     $jobSubType = $distributionProfile->getProviderType();
     return kJobsManager::addJob($batchJob, $jobData, $jobType, $jobSubType);
 }
 /**
  * @param BatchJob $dbBatchJob
  * @param kDistributionFetchReportJobData $data
  * @param BatchJob $twinJob
  * @return BatchJob
  */
 public static function onDistributionFetchReportJobFinished(BatchJob $dbBatchJob, kDistributionFetchReportJobData $data, BatchJob $twinJob = null)
 {
     $entryDistribution = EntryDistributionPeer::retrieveByPK($data->getEntryDistributionId());
     if (!$entryDistribution) {
         KalturaLog::err("Entry distribution [" . $data->getEntryDistributionId() . "] not found");
         return $dbBatchJob;
     }
     $entryDistribution->setPlays($data->getPlays());
     $entryDistribution->setViews($data->getViews());
     $entryDistribution->save();
     return $dbBatchJob;
 }