本文整理匯總了PHP中BatchJob::getAbort方法的典型用法代碼示例。如果您正苦於以下問題:PHP BatchJob::getAbort方法的具體用法?PHP BatchJob::getAbort怎麽用?PHP BatchJob::getAbort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BatchJob
的用法示例。
在下文中一共展示了BatchJob::getAbort方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handleBulkDownloadFinished
public static function handleBulkDownloadFinished(BatchJob $dbBatchJob, kBulkDownloadJobData $data, BatchJob $twinJob = null)
{
if ($dbBatchJob->getAbort()) {
return $dbBatchJob;
}
$partner = PartnerPeer::retrieveByPK($dbBatchJob->getPartnerId());
if (!$partner) {
KalturaLog::err("Partner id [" . $dbBatchJob->getPartnerId() . "] not found, not sending mail");
return $dbBatchJob;
}
$adminName = $partner->getAdminName();
$entryIds = explode(",", $data->getEntryIds());
$flavorParamsId = $data->getFlavorParamsId();
$links = array();
foreach ($entryIds as $entryId) {
$entry = entryPeer::retrieveByPK($entryId);
if (is_null($entry)) {
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->setBodyParamsArray(array($adminName, $linksHtml));
$jobData->setFromEmail(kConf::get("batch_download_video_sender_email"));
$jobData->setFromName(kConf::get("batch_download_video_sender_name"));
$kuser = kuserPeer::getKuserByPartnerAndUid($dbBatchJob->getPartnerId(), $data->getPuserId());
if ($kuser) {
$recipientEmail = $kuser->getEmail();
} else {
KalturaLog::err('Cannot find kuser with puserId [' . $dbBatchJob->getPartnerId() . '] and partnerId [' . $data->getPuserId() . ']. Sending mail to admin user instead.');
$recipientEmail = $partner->getAdminEmail();
}
$jobData->setRecipientEmail($recipientEmail);
$jobData->setSubjectParamsArray(array());
kJobsManager::addJob($dbBatchJob->createChild(), $jobData, BatchJobType::MAIL, $jobData->getMailType());
return $dbBatchJob;
}