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


PHP kJobsManager::addStorageDeleteJob方法代码示例

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


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

示例1: objectDeleted

 public function objectDeleted(BaseObject $object, BatchJob $raisedJob = null)
 {
     /* @var $object FileSync */
     $syncKey = kFileSyncUtils::getKeyForFileSync($object);
     $entryId = null;
     switch ($object->getObjectType()) {
         case FileSyncObjectType::ENTRY:
             $entryId = $object->getObjectId();
             break;
         case FileSyncObjectType::BATCHJOB:
             BatchJobPeer::setUseCriteriaFilter(false);
             $batchJob = BatchJobPeer::retrieveByPK($object->getObjectId());
             if ($batchJob) {
                 $entryId = $batchJob->getEntryId();
             }
             BatchJobPeer::setUseCriteriaFilter(true);
             break;
         case FileSyncObjectType::ASSET:
             assetPeer::setUseCriteriaFilter(false);
             $asset = assetPeer::retrieveById($object->getId());
             if ($asset) {
                 $entryId = $asset->getEntryId();
                 //the next piece of code checks whether the entry to which
                 //the deleted asset belongs to is a "replacement" entry
                 $entry = entryPeer::retrieveByPKNoFilter($entryId);
                 if (!$entry) {
                     KalturaLog::alert("No entry found by the ID of [{$entryId}]");
                 } else {
                     if ($entry->getReplacedEntryId()) {
                         KalturaLog::info("Will not handle event - deleted asset belongs to replacement entry");
                         return;
                     }
                 }
             }
             assetPeer::setUseCriteriaFilter(true);
             break;
     }
     $storage = StorageProfilePeer::retrieveByPK($object->getDc());
     kJobsManager::addStorageDeleteJob($raisedJob, $entryId, $storage, $object);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:40,代码来源:kStorageExporter.php

示例2: delete

 /**
  * 
  * add DeleteStorage job for key
  * 
  * @param entry $entry
  * @param StorageProfile $profile
  * @param FileSyncKey $key
  */
 protected static function delete(entry $entry, StorageProfile $profile, FileSyncKey $key)
 {
     $externalFileSync = kFileSyncUtils::getReadyPendingExternalFileSyncForKey($key, $profile->getId());
     if (!$externalFileSync) {
         return;
     }
     $c = new Criteria();
     $c->add(BatchJobPeer::OBJECT_ID, $externalFileSync->getId());
     $c->add(BatchJobPeer::OBJECT_TYPE, BatchJobObjectType::FILE_SYNC);
     $c->add(BatchJobPeer::JOB_TYPE, BatchJobType::STORAGE_EXPORT);
     $c->add(BatchJobPeer::JOB_SUB_TYPE, $profile->getProtocol());
     $c->add(BatchJobPeer::ENTRY_ID, $entry->getId());
     $c->add(BatchJobPeer::STATUS, array(BatchJob::BATCHJOB_STATUS_RETRY, BatchJob::BATCHJOB_STATUS_PENDING), Criteria::IN);
     $exportJobs = BatchJobPeer::doSelect($c);
     if (!$exportJobs) {
         kJobsManager::addStorageDeleteJob(null, $entry->getId(), $profile, $externalFileSync);
     } else {
         foreach ($exportJobs as $exportJob) {
             kJobsManager::abortDbBatchJob($exportJob);
         }
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:kStorageExporter.php


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