本文整理汇总了PHP中kJobsManager::abortJob方法的典型用法代码示例。如果您正苦于以下问题:PHP kJobsManager::abortJob方法的具体用法?PHP kJobsManager::abortJob怎么用?PHP kJobsManager::abortJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kJobsManager
的用法示例。
在下文中一共展示了kJobsManager::abortJob方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: abortAction
/**
* Aborts the bulk upload and all its child jobs
*
* @action abort
* @param int $id job id
* @return KalturaBulkUpload
*/
function abortAction($id)
{
$c = new Criteria();
$c->addAnd(BatchJobPeer::ID, $id);
$c->addAnd(BatchJobPeer::PARTNER_ID, $this->getPartnerId());
$c->addAnd(BatchJobPeer::JOB_TYPE, BatchJobType::BULKUPLOAD);
$batchJob = BatchJobPeer::doSelectOne($c);
if (!$batchJob) {
throw new KalturaAPIException(KalturaErrors::BULK_UPLOAD_NOT_FOUND, $id);
}
kJobsManager::abortJob($id, BatchJobType::BULKUPLOAD, true);
$batchJobLog = BatchJobLogPeer::retrieveByBatchJobId($id);
$ret = new KalturaBulkUpload();
if ($batchJobLog) {
$ret->fromObject($batchJobLog, $this->getResponseProfile());
}
return $ret;
}
示例2: abortJobAction
/**
* batch abortJobAction aborts and returns the status of task
*
* @action abortJob
* @param int $jobId the id of the job
* @param KalturaBatchJobType $jobType the type of the job
* @return KalturaBatchJobResponse
*/
function abortJobAction($jobId, $jobType)
{
$dbJobType = kPluginableEnumsManager::apiToCore('BatchJobType', $jobType);
kJobsManager::abortJob($jobId, $dbJobType);
return $this->getStatusAction($jobId, $jobType);
}
示例3: abortAction
/**
* Aborts the bulk upload and all its child jobs
*
* @action abort
* @param bigint $id job id
* @return KalturaBulkUpload
*/
public function abortAction($id)
{
$c = new Criteria();
$c->addAnd(BatchJobPeer::ID, $id);
$c->addAnd(BatchJobPeer::PARTNER_ID, $this->getPartnerId());
$c->addAnd(BatchJobPeer::JOB_TYPE, BatchJobType::BULKUPLOAD);
$batchJob = BatchJobPeer::doSelectOne($c);
if (!$batchJob) {
$c = new Criteria();
$c->addAnd(BatchJobLogPeer::JOB_ID, $id);
$c->addAnd(BatchJobLogPeer::PARTNER_ID, $this->getPartnerId());
$c->addAnd(BatchJobLogPeer::JOB_TYPE, BatchJobType::BULKUPLOAD);
$crit = $c->getNewCriterion(BatchJobLogPeer::ABORT, null);
$critOr = $c->getNewCriterion(BatchJobLogPeer::ABORT, 0);
$crit->addOr($critOr);
$c->add($crit);
$batchJobLog = BatchJobLogPeer::doSelectOne($c);
if (!$batchJobLog) {
throw new KalturaAPIException(KalturaErrors::BULK_UPLOAD_NOT_FOUND, $id);
}
$batchJobLog->setAbort(BatchJobExecutionStatus::ABORTED);
$batchJobLog->save();
} else {
kJobsManager::abortJob($id, BatchJobType::BULKUPLOAD, true);
}
$batchJobLog = BatchJobLogPeer::retrieveByBatchJobId($id);
$ret = new KalturaBulkUpload();
$ret->fromObject($batchJobLog, $this->getResponseProfile());
return $ret;
}