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


PHP BatchJobPeer::retrieveByPK方法代码示例

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


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

示例1: notifyAction

 /**
  * @action notify
  * @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
  * @param int $id integration job id
  */
 public function notifyAction($id)
 {
     $coreType = IntegrationPlugin::getBatchJobTypeCoreValue(IntegrationBatchJobType::INTEGRATION);
     $batchJob = BatchJobPeer::retrieveByPK($id);
     $invalidJobId = false;
     $invalidKs = false;
     if (!self::validateKs($batchJob)) {
         $invalidKs = true;
         KalturaLog::err("ks not valid for notifying job [{$id}]");
     } elseif (!$batchJob) {
         $invalidJobId = true;
         KalturaLog::err("Job [{$id}] not found");
     } elseif ($batchJob->getJobType() != $coreType) {
         $invalidJobId = true;
         KalturaLog::err("Job [{$id}] wrong type [" . $batchJob->getJobType() . "] expected [" . $coreType . "]");
     } elseif ($batchJob->getStatus() != KalturaBatchJobStatus::ALMOST_DONE) {
         $invalidJobId = true;
         KalturaLog::err("Job [{$id}] wrong status [" . $batchJob->getStatus() . "] expected [" . KalturaBatchJobStatus::ALMOST_DONE . "]");
     } elseif ($batchJob->getPartnerId() != kCurrentContext::getCurrentPartnerId()) {
         $invalidKs = true;
         KalturaLog::err("Job [{$id}] of wrong partner [" . $batchJob->getPartnerId() . "] expected [" . kCurrentContext::getCurrentPartnerId() . "]");
     }
     if ($invalidJobId) {
         throw new KalturaAPIException(KalturaErrors::INVALID_BATCHJOB_ID, $id);
     }
     if ($invalidKs) {
         throw new KalturaAPIException(KalturaIntegrationErrors::INTEGRATION_NOTIFY_FAILED);
     }
     kJobsManager::updateBatchJob($batchJob, KalturaBatchJobStatus::FINISHED);
 }
开发者ID:DBezemer,项目名称:server,代码行数:35,代码来源:IntegrationService.php

示例2: execute

 /**
  * Will investigate a single entry
  */
 public function execute()
 {
     $this->forceSystemAuthentication();
     $batchjob_id = @$_REQUEST["batchjob_id"];
     $entry_id = @$_REQUEST["entry_id"];
     $job = BatchJobPeer::retrieveByPK($batchjob_id);
     if ($job) {
         $job->setStatus(BatchJob::BATCHJOB_STATUS_PENDING);
         $job->save();
     }
     $this->redirect("/system/investigate?entry_id={$entry_id}");
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:15,代码来源:restartJobAction.class.php

示例3: updateExclusiveFileSyncImportJobAction

 /**
  * batch updateExclusiveFileSyncImportJob action updates a BatchJob of type FILESYNC_IMPORT that was claimed using the getExclusiveFileSyncImportJobs
  * 
  * @action updateExclusiveFileSyncImportJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveFileSyncImportJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     // verifies that the job is of the right type
     if ($dbBatchJob->getJobType() != KalturaBatchJobType::FILESYNC_IMPORT) {
         throw new KalturaAPIException(APIErrors::UPDATE_EXCLUSIVE_JOB_WRONG_TYPE, $id, serialize($lockKey), serialize($job));
     }
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:21,代码来源:FileSyncImportBatchService.php

示例4: updateExclusiveVirusScanJobAction

 /**
  * batch updateExclusiveVirusScanJob action updates a BatchJob of type VIRUS_SCAN that was claimed using the getExclusiveVirusScanJobs
  * 
  * @action updateExclusiveVirusScanJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveVirusScanJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     // verifies that the job is of the right type
     $jobType = VirusScanPlugin::getBatchJobTypeCoreValue(VirusScanBatchJobType::VIRUS_SCAN);
     if ($dbBatchJob->getJobType() != $jobType) {
         throw new KalturaAPIException(APIErrors::UPDATE_EXCLUSIVE_JOB_WRONG_TYPE, $id, serialize($lockKey), serialize($job));
     }
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:22,代码来源:VirusScanBatchService.php

示例5: retrieveObject

 /**
  * 
  * @param int $objectType
  * @param string $objectId
  * @return ISyncableFile
  */
 public static function retrieveObject($objectType, $objectId)
 {
     $object = null;
     switch ($objectType) {
         case FileSyncObjectType::ENTRY:
             entryPeer::setUseCriteriaFilter(false);
             $object = entryPeer::retrieveByPK($objectId);
             entryPeer::setUseCriteriaFilter(true);
             break;
         case FileSyncObjectType::UICONF:
             uiConfPeer::setUseCriteriaFilter(false);
             $object = uiConfPeer::retrieveByPK($objectId);
             uiConfPeer::setUseCriteriaFilter(true);
             break;
         case FileSyncObjectType::BATCHJOB:
             BatchJobPeer::setUseCriteriaFilter(false);
             $object = BatchJobPeer::retrieveByPK($objectId);
             BatchJobPeer::setUseCriteriaFilter(true);
             break;
         case FileSyncObjectType::FLAVOR_ASSET:
             assetPeer::setUseCriteriaFilter(false);
             $object = assetPeer::retrieveById($objectId);
             assetPeer::setUseCriteriaFilter(true);
             break;
         case FileSyncObjectType::SYNDICATION_FEED:
             syndicationFeedPeer::setUseCriteriaFilter(false);
             $object = syndicationFeedPeer::retrieveByPK($objectId);
             syndicationFeedPeer::setUseCriteriaFilter(true);
             break;
         case FileSyncObjectType::CONVERSION_PROFILE:
             conversionProfile2Peer::setUseCriteriaFilter(false);
             $object = conversionProfile2Peer::retrieveByPK($objectId);
             conversionProfile2Peer::setUseCriteriaFilter(true);
             break;
         case FileSyncObjectType::FILE_ASSET:
             conversionProfile2Peer::setUseCriteriaFilter(false);
             $object = FileAssetPeer::retrieveByPK($objectId);
             conversionProfile2Peer::setUseCriteriaFilter(true);
             break;
     }
     if ($object == null) {
         $object = KalturaPluginManager::loadObject('ISyncableFile', $objectType, array('objectId' => $objectId));
     }
     if ($object == null) {
         $error = __METHOD__ . " Cannot find object type [" . $objectType . "] with object_id [" . $objectId . "]";
         KalturaLog::err($error);
         throw new kFileSyncException($error);
     }
     return $object;
 }
开发者ID:DBezemer,项目名称:server,代码行数:56,代码来源:kFileSyncObjectManager.php

示例6: getEntryId

 public function getEntryId(FileSync $fileSync)
 {
     if ($fileSync->getObjectType() == FileSyncObjectType::ENTRY) {
         return $fileSync->getObjectId();
     }
     if ($fileSync->getObjectType() == FileSyncObjectType::BATCHJOB) {
         $job = BatchJobPeer::retrieveByPK($fileSync->getObjectId());
         if ($job) {
             return $job->getEntryId();
         }
     }
     if ($fileSync->getObjectType() == FileSyncObjectType::FLAVOR_ASSET) {
         $flavor = flavorAssetPeer::retrieveById($fileSync->getObjectId());
         if ($flavor) {
             return $flavor->getEntryId();
         }
     }
     return null;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:19,代码来源:kMultiCentersSynchronizer.php

示例7: notifyAction

 /**
  * @action notify
  * @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
  * @param int $id integration job id
  */
 public function notifyAction($id)
 {
     $coreType = IntegrationPlugin::getBatchJobTypeCoreValue(IntegrationBatchJobType::INTEGRATION);
     $batchJob = BatchJobPeer::retrieveByPK($id);
     $invalid = false;
     if (!$batchJob) {
         $invalid = true;
         KalturaLog::err("Job [{$id}] not found");
     } elseif ($batchJob->getJobType() != $coreType) {
         $invalid = true;
         KalturaLog::err("Job [{$id}] wrong type [" . $batchJob->getJobType() . "] expected [" . $coreType . "]");
     } elseif ($batchJob->getStatus() != KalturaBatchJobStatus::ALMOST_DONE) {
         $invalid = true;
         KalturaLog::err("Job [{$id}] wrong status [" . $batchJob->getStatus() . "] expected [" . KalturaBatchJobStatus::ALMOST_DONE . "]");
     }
     if ($invalid) {
         throw new KalturaAPIException(KalturaErrors::INVALID_BATCHJOB_ID, $id);
     }
     kJobsManager::updateBatchJob($batchJob, KalturaBatchJobStatus::FINISHED);
 }
开发者ID:visomar,项目名称:server,代码行数:25,代码来源:IntegrationService.php

示例8: notifyAction

 /**
  * @action notify
  * @disableTags TAG_WIDGET_SESSION,TAG_ENTITLEMENT_ENTRY,TAG_ENTITLEMENT_CATEGORY
  * @param int $id distribution job id
  */
 public function notifyAction($id)
 {
     $submitCoreType = ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_SUBMIT);
     $updateCoreType = ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_UPDATE);
     $deleteCoreType = ContentDistributionPlugin::getBatchJobTypeCoreValue(ContentDistributionBatchJobType::DISTRIBUTION_DELETE);
     $validJobTypes = array($submitCoreType, $updateCoreType, $deleteCoreType);
     $batchJob = BatchJobPeer::retrieveByPK($id);
     $invalid = false;
     if (!$batchJob) {
         $invalid = true;
         KalturaLog::err("Job [{$id}] not found");
     } elseif (!in_array($batchJob->getJobType(), $validJobTypes)) {
         $invalid = true;
         KalturaLog::err("Job [{$id}] wrong type [" . $batchJob->getJobType() . "] expected [" . implode(', ', $validJobTypes) . "]");
     } elseif ($batchJob->getJobSubType() != UnicornDistributionProvider::get()->getType()) {
         $invalid = true;
         KalturaLog::err("Job [{$id}] wrong sub-type [" . $batchJob->getJobSubType() . "] expected [" . UnicornDistributionProvider::get()->getType() . "]");
     } elseif ($batchJob->getStatus() != KalturaBatchJobStatus::ALMOST_DONE) {
         $invalid = true;
         KalturaLog::err("Job [{$id}] wrong status [" . $batchJob->getStatus() . "] expected [" . KalturaBatchJobStatus::ALMOST_DONE . "]");
     }
     if ($invalid) {
         throw new KalturaAPIException(KalturaErrors::INVALID_BATCHJOB_ID, $id);
     }
     kJobsManager::updateBatchJob($batchJob, KalturaBatchJobStatus::FINISHED);
     $data = $batchJob->getData();
     /* @var $data kDistributionJobData */
     $providerData = $data->getProviderData();
     /* @var $providerData kUnicornDistributionJobProviderData */
     $entryDistribution = EntryDistributionPeer::retrieveByPK($data->getEntryDistributionId());
     if ($entryDistribution) {
         $entryDistribution->putInCustomData(kUnicornDistributionJobProviderData::CUSTOM_DATA_FLAVOR_ASSET_OLD_VERSION, $providerData->getFlavorAssetVersion());
         $entryDistribution->save();
     }
     if ($batchJob->getJobType() == $submitCoreType) {
         $this->attachRemoteAssetResource($batchJob->getEntry(), $batchJob->getData());
     }
     if ($batchJob->getJobType() == $deleteCoreType) {
         $this->detachRemoteAssetResource($batchJob->getEntry(), $batchJob->getData());
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:46,代码来源:UnicornService.php

示例9: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $job_type = $this->getPM("job_type");
     $processor_name = $this->getPM("processor_name");
     $processor_timeout = $this->getPM("processor_timeout");
     $over_quota_partners = $this->getPM("over_quota_partners");
     $defered_partners = $this->getPM("defered_partners");
     $con = Propel::getConnection();
     // fetch one pending row of a given job_type
     // where the over_quota_partner requests are dropped
     // and defered_partners request are of less priority
     $query = "SELECT " . BatchJobPeer::ID . " FROM " . BatchJobPeer::TABLE_NAME . " WHERE " . BatchJobPeer::STATUS . "=" . BatchJob::BATCHJOB_STATUS_PENDING . " AND " . BatchJobPeer::JOB_TYPE . "=" . $job_type . " " . (count($over_quota_partners) ? " AND " . BatchJobPeer::PARTNER_ID . " NOT IN ({$over_quota_partners}) " : "") . " ORDER BY " . (count($defered_partners) ? BatchJobPeer::PARTNER_ID . " IN ({$defered_partners}), " : "") . BatchJobPeer::CREATED_AT . " LIMIT 1";
     $statement = $con->prepareStatement($query);
     $resultset = $statement->executeQuery();
     $batch_job = null;
     while ($resultset->next()) {
         $batch_job = BatchJobPeer::retrieveByPK($resultset->getInt('ID'));
     }
     $batch_job = BatchJobPeer::doSelectOne($c);
     if ($batch_job) {
         // force update to work on the currently selected row and ensure it is still in pending status
         $c->add(BatchJobPeer::ID, $batch_job->getId());
         $c->add(BatchJobPeer::STATUS, BatchJob::BATCHJOB_STATUS_PENDING);
         $update = new Criteria();
         $update->add(BatchJobPeer::STATUS, BatchJob::BATCHJOB_STATUS_QUEUED);
         $update->add(BatchJobPeer::PROCESSOR_NAME, $processor_name);
         $update->add(BatchJobPeer::PROCESSOR_EXPIRATION, time() + $processor_timeout);
         $affectedRows = BasePeer::doUpdate($c, $update, $con);
         if ($affectedRows != 1) {
             $batch_job = null;
         }
     }
     if (!$batch_job) {
         //xx$this->addError ( APIErrors::INVALID_ENTRY_ID, $this->getObjectPrefix() , $entry_id );
     } else {
         $wrapper = objectWrapperBase::getWrapperClass($batch_job, objectWrapperBase::DETAIL_LEVEL_REGULAR);
         // TODO - remove this code when cache works properly when saving objects (in their save method)
         $wrapper->removeFromCache("batch_job", $batch_job->getId());
         $this->addMsg("batchjob", $wrapper);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:41,代码来源:queuependingbatchjobAction.class.php

示例10: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $prefix = $this->getObjectPrefix();
     $batchjob_id = $this->getPM("{$prefix}_id");
     $batchjob = BatchJobPeer::retrieveByPK($batchjob_id);
     if (!$batchjob) {
         $this->addError(APIErrors::INVALID_BATCHJOB_ID, $batchjob_id);
         return;
     }
     // get the new properties for the batchjob from the request
     $batchjob_update_data = new BatchJob();
     $obj_wrapper = objectWrapperBase::getWrapperClass($batchjob_update_data, 0);
     $fields_modified = baseObjectUtils::fillObjectFromMap($this->getInputParams(), $batchjob_update_data, "{$prefix}_", $obj_wrapper->getUpdateableFields());
     if (count($fields_modified) > 0) {
         if ($batchjob_update_data) {
             baseObjectUtils::fillObjectFromObject($obj_wrapper->getUpdateableFields(), $batchjob_update_data, $batchjob, baseObjectUtils::CLONE_POLICY_PREFER_NEW, null, BasePeer::TYPE_PHPNAME);
         }
         $batchjob->save();
     }
     $wrapper = objectWrapperBase::getWrapperClass($batchjob, objectWrapperBase::DETAIL_LEVEL_REGULAR);
     $wrapper->removeFromCache("batchjob", $batchjob->getId());
     $this->addMsg("{$prefix}", $wrapper);
     $this->addDebug("modified_fields", $fields_modified);
 }
开发者ID:DBezemer,项目名称:server,代码行数:24,代码来源:updatebatchjobAction.class.php

示例11: getRootJob

 /**
  * @return BatchJob
  */
 public function getRootJob()
 {
     if ($this->aRootJob == null && $this->getRootJobId()) {
         $this->aRootJob = BatchJobPeer::retrieveByPK($this->getRootJobId());
     }
     return $this->aRootJob;
 }
开发者ID:DBezemer,项目名称:server,代码行数:10,代码来源:BatchJob.php

示例12: updateExclusiveJobAction

 /**
  * batch updateExclusiveJobAction action updates a BatchJob of extended type that was claimed using the getExclusiveJobs
  * 
  * @action updateExclusiveJob
  * @param int $id The id of the job to free
  * @param KalturaExclusiveLockKey $lockKey The unique lock key from the batch-process. Is used for the locking mechanism  
  * @param KalturaBatchJob $job
  * @return KalturaBatchJob 
  */
 function updateExclusiveJobAction($id, KalturaExclusiveLockKey $lockKey, KalturaBatchJob $job)
 {
     $dbBatchJob = BatchJobPeer::retrieveByPK($id);
     $dbBatchJob = kBatchManager::updateExclusiveBatchJob($id, $lockKey->toObject(), $job->toObject($dbBatchJob));
     $batchJob = new KalturaBatchJob();
     // start from blank
     return $batchJob->fromObject($dbBatchJob);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:BatchService.php

示例13: freeExclusive

 /**
  *
  * @param $id
  * @param kExclusiveLockKey db_lock_object
  * @param db_lock_objectstatus - optional. will be used to set the status once the object is free
  * @return BatchJob
  */
 public static function freeExclusive($id, kExclusiveLockKey $lockKey, $resetExecutionAttempts = false)
 {
     $c = new Criteria();
     $c->add(BatchJobLockPeer::ID, $id);
     $c->add(BatchJobLockPeer::SCHEDULER_ID, $lockKey->getSchedulerId());
     $c->add(BatchJobLockPeer::WORKER_ID, $lockKey->getWorkerId());
     $c->add(BatchJobLockPeer::BATCH_INDEX, $lockKey->getBatchIndex());
     $db_lock_object = BatchJobLockPeer::doSelectOne($c);
     if (!$db_lock_object) {
         if (BatchJobLockPeer::retrieveByPK($id)) {
             throw new APIException(APIErrors::FREE_EXCLUSIVE_JOB_FAILED, $id, $lockKey->getSchedulerId(), $lockKey->getWorkerId(), $lockKey->getBatchIndex());
         } else {
             return BatchJobPeer::retrieveByPK($id);
         }
     }
     $db_object = $db_lock_object->getBatchJob();
     if ($resetExecutionAttempts || in_array($db_lock_object->getStatus(), BatchJobPeer::getClosedStatusList())) {
         $db_lock_object->setExecutionAttempts(0);
     }
     $db_lock_object->setSchedulerId(null);
     $db_lock_object->setWorkerId(null);
     $db_lock_object->setBatchIndex(null);
     $db_lock_object->setExpiration(null);
     $db_lock_object->save();
     if ($db_object->getStatus() != BatchJob::BATCHJOB_STATUS_ABORTED && $db_object->getExecutionStatus() == BatchJobExecutionStatus::ABORTED) {
         $db_object = kJobsManager::abortDbBatchJob($db_object);
     }
     return $db_object;
 }
开发者ID:DBezemer,项目名称:server,代码行数:36,代码来源:kBatchExclusiveLock.class.php

示例14: updateJob

 private function updateJob(KalturaBatchJob $job)
 {
     $dbJob = BatchJobPeer::retrieveByPK($job->id);
     $dbJob = $job->toObject($dbJob);
     $dbJob->save();
 }
开发者ID:AdiTal,项目名称:server,代码行数:6,代码来源:FileSyncImportBatchService.php

示例15: getStatusAction

 /**
  * batch getStatusAction returns the status of task
  * 
  * @action getStatus
  * @param int $jobId the id of the job  
  * @param KalturaBatchJobType $jobType the type of the job
  * @param KalturaFilterPager $pager pager for the child jobs  
  * @return KalturaBatchJobResponse 
  */
 function getStatusAction($jobId, $jobType, KalturaFilterPager $pager = null)
 {
     $dbJobType = kPluginableEnumsManager::apiToCore('BatchJobType', $jobType);
     $dbBatchJob = BatchJobPeer::retrieveByPK($jobId);
     if ($dbBatchJob->getJobType() != $dbJobType) {
         throw new KalturaAPIException(APIErrors::GET_EXCLUSIVE_JOB_WRONG_TYPE, $jobType, $dbBatchJob->getId());
     }
     $job = new KalturaBatchJob();
     $job->fromObject($dbBatchJob);
     $batchJobResponse = new KalturaBatchJobResponse();
     $batchJobResponse->batchJob = $job;
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $c = new Criteria();
     $pager->attachToCriteria($c);
     $childBatchJobs = $dbBatchJob->getChildJobs($c);
     $batchJobResponse->childBatchJobs = KalturaBatchJobArray::fromBatchJobArray($childBatchJobs);
     return $batchJobResponse;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:29,代码来源:JobsService.php


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