本文整理汇总了PHP中BatchJob::setSubpId方法的典型用法代码示例。如果您正苦于以下问题:PHP BatchJob::setSubpId方法的具体用法?PHP BatchJob::setSubpId怎么用?PHP BatchJob::setSubpId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BatchJob
的用法示例。
在下文中一共展示了BatchJob::setSubpId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addJob
/**
* @param string $puser_id
* @param string $entry
* @param string $version
* @param string $file_format
* @return BatchJob
*/
public static function addJob($puser_id, $entry, $version, $file_format)
{
$entryId = $entry->getId();
$entryIntId = $entry->getIntId();
$entryVersion = $version ? $version : $entry->getVersion();
if ($entry) {
$partner = $entry->getPartner();
$email = $partner->getAdminEmail();
}
$data = json_encode(array('puserId' => $puser_id, 'entryId' => $entryId, 'entryIntId' => $entryIntId, 'entryVersion' => $entryVersion, 'fileFormat' => $file_format, 'email' => $email));
$job = new BatchJob();
$job->setJobType(BatchJobType::FLATTEN);
$job->setData($data, true);
$job->setStatus(BatchJob::BATCHJOB_STATUS_PENDING);
$job->setCheckAgainTimeout(time() + 10);
$job->setProgress(0);
$job->setMessage('Queued');
$job->setDescription('Queued, waiting to run');
$job->setUpdatesCount(0);
$job->setEntryId($entryId);
$job->setPartnerId($entry->getPartnerId());
$job->setSubpId($entry->getSubpId());
$job->save();
return $job;
}
示例2: executeImpl
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
{
$entry_id = $this->getPM("entry_id");
$entry = entryPeer::retrieveByPK($entry_id);
if (!$entry) {
$this->addError(APIErrors::INVALID_ENTRY_ID, "entry", $entry_id);
} else {
$job = new BatchJob();
$job->setJobType(BatchJobType::DVDCREATOR);
$job->setStatus(BatchJob::BATCHJOB_STATUS_PENDING);
//$job->setCheckAgainTimeout(time() + 10);
$job->setEntryId($entry_id);
$job->setPartnerId($entry->getPartnerId());
$job->setSubpId($entry->getSubpId());
$job->save();
$wrapper = objectWrapperBase::getWrapperClass($job, objectWrapperBase::DETAIL_LEVEL_DETAILED);
// TODO - remove this code when cache works properly when saving objects (in their save method)
$wrapper->removeFromCache("batch_job", $job->getId());
$this->addMsg("batchjob", $wrapper);
}
}
示例3: createChild
/**
* @return BatchJob
*/
public function createChild($same_root = true)
{
$child = new BatchJob();
$child->setStatus(self::BATCHJOB_STATUS_PENDING);
$child->setParentJobId($this->id);
$child->setPartnerId($this->partner_id);
$child->setEntryId($this->entry_id);
$child->setPriority($this->priority);
$child->setSubpId($this->subp_id);
$child->setBulkJobId($this->bulk_job_id);
$child->setDc($this->dc);
if ($same_root && $this->root_job_id) {
$child->setRootJobId($this->root_job_id);
} else {
$child->setRootJobId($this->id);
}
$child->save();
return $child;
}
示例4: createChild
/**
* @return BatchJob
*/
public function createChild($same_root = true, $dc = null)
{
$child = new BatchJob();
$child->setStatus(self::BATCHJOB_STATUS_PENDING);
$child->setParentJobId($this->id);
$child->setPartnerId($this->partner_id);
$child->setEntryId($this->entry_id);
$child->setPriority($this->priority);
$child->setSubpId($this->subp_id);
$child->setBulkJobId($this->bulk_job_id);
// the condition is required in the special case of file_sync import jobs which are created on one dc but run from the other
$child->setDc($dc === null ? $this->dc : $dc);
if ($same_root && $this->root_job_id) {
$child->setRootJobId($this->root_job_id);
} else {
$child->setRootJobId($this->id);
}
$child->save();
return $child;
}