当前位置: 首页>>代码示例>>PHP>>正文


PHP BatchJob::getExecutionStatus方法代码示例

本文整理汇总了PHP中BatchJob::getExecutionStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP BatchJob::getExecutionStatus方法的具体用法?PHP BatchJob::getExecutionStatus怎么用?PHP BatchJob::getExecutionStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BatchJob的用法示例。


在下文中一共展示了BatchJob::getExecutionStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: copyModifiedColumns

 protected function copyModifiedColumns(BatchJobLog $batchJobLog, BatchJob $batchJob, array $modifiedColumns)
 {
     $shouldSkipInTranslation = array(BatchJobPeer::LOCK_INFO, BatchJobPeer::HISTORY, BatchJobPeer::BATCH_JOB_LOCK_ID, BatchJobPeer::EXECUTION_STATUS);
     foreach ($modifiedColumns as $modifiedColumn) {
         $fieldPosLog = -1;
         try {
             if (in_array($modifiedColumn, $shouldSkipInTranslation)) {
                 if ($modifiedColumn == BatchJobPeer::EXECUTION_STATUS) {
                     $batchJobLog->setAbort($batchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED);
                 }
                 continue;
             }
             $fieldName = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME);
             $fieldPosJob = BatchJobPeer::translateFieldName($modifiedColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_NUM);
             $fieldPosLog = BatchJobLogPeer::translateFieldName($fieldName, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM);
         } catch (PropelException $e) {
             KalturaLog::err("Could not set value for BatchJobLog field {$fieldName}, exception thrown: " . $e->getMessage());
         }
         if ($fieldPosLog != -1) {
             $batchJobLog->setByPosition($fieldPosLog, $batchJob->getByPosition($fieldPosJob));
         }
         if ($modifiedColumn == BatchJobPeer::DATA) {
             //set param_1 for the $batchJobLog
             $batchJobData = $batchJob->getData();
             /* @var $batchJobData kBulkUploadJobData */
             $batchJobLog->setParam1($batchJobData->getBulkUploadObjectType());
         }
     }
     return $batchJobLog;
 }
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:kBatchJobLogManager.php

示例2: handleBulkDownloadFinished

 public static function handleBulkDownloadFinished(BatchJob $dbBatchJob, kBulkDownloadJobData $data)
 {
     if ($dbBatchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED) {
         return $dbBatchJob;
     }
     $partner = PartnerPeer::retrieveByPK($dbBatchJob->getPartnerId());
     if (!$partner) {
         KalturaLog::err("Partner id [" . $dbBatchJob->getPartnerId() . "] not found, not sending mail");
         return $dbBatchJob;
     }
     $entryIds = explode(",", $data->getEntryIds());
     $flavorParamsId = $data->getFlavorParamsId();
     $links = array();
     foreach ($entryIds as $entryId) {
         $entry = entryPeer::retrieveByPK($entryId);
         if (is_null($entry)) {
             continue;
         }
         if ($entry->getType() != entryType::MEDIA_CLIP) {
             KalturaLog::info("This entry cannot be downloaded {$entryId}");
             continue;
         }
         $link = $entry->getDownloadAssetUrl($flavorParamsId);
         if (is_null($link)) {
             $link = "Failed to prepare";
         } else {
             $link = '<a href="' . $link . '">Download</a>';
         }
         $links[] = $entry->getName() . " - " . $link;
     }
     $linksHtml = implode("<br />", $links);
     // add mail job
     $jobData = new kMailJobData();
     $jobData->setIsHtml(true);
     $jobData->setMailPriority(kMailJobData::MAIL_PRIORITY_NORMAL);
     $jobData->setStatus(kMailJobData::MAIL_STATUS_PENDING);
     if (count($links) <= 1) {
         $jobData->setMailType(62);
     } else {
         $jobData->setMailType(63);
     }
     $jobData->setFromEmail(kConf::get("batch_download_video_sender_email"));
     $jobData->setFromName(kConf::get("batch_download_video_sender_name"));
     $adminName = $partner->getAdminName();
     $recipientEmail = $partner->getAdminEmail();
     $kuser = kuserPeer::getKuserByPartnerAndUid($dbBatchJob->getPartnerId(), $data->getPuserId());
     if ($kuser) {
         $recipientEmail = $kuser->getEmail();
         $adminName = $kuser->getFullName();
     }
     if (!$adminName) {
         $adminName = $recipientEmail;
     }
     $jobData->setSeparator(self::BULK_DOWNLOAD_EMAIL_PARAMS_SEPARATOR);
     $jobData->setBodyParamsArray(array($adminName, $linksHtml));
     $jobData->setRecipientEmail($recipientEmail);
     $jobData->setSubjectParamsArray(array());
     kJobsManager::addJob($dbBatchJob->createChild(BatchJobType::MAIL, $jobData->getMailType()), $jobData, BatchJobType::MAIL, $jobData->getMailType());
     return $dbBatchJob;
 }
开发者ID:GElkayam,项目名称:server,代码行数:60,代码来源:kFlowHelper.php


注:本文中的BatchJob::getExecutionStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。