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


PHP assetPeer::retrieveByIdNoFilter方法代码示例

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


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

示例1: addCaptionsData

 private function addCaptionsData(KalturaDistributionJobData $distributionJobData)
 {
     $assetIdsArray = explode(',', $distributionJobData->entryDistribution->assetIds);
     if (empty($assetIdsArray)) {
         return;
     }
     $this->captionsInfo = new KalturaCaptionDistributionInfoArray();
     foreach ($assetIdsArray as $assetId) {
         $asset = assetPeer::retrieveByIdNoFilter($assetId);
         if (!$asset) {
             KalturaLog::err("Asset [{$assetId}] not found");
             continue;
         }
         if ($asset->getType() != CaptionPlugin::getAssetTypeCoreValue(CaptionAssetType::CAPTION)) {
             KalturaLog::debug("Asset [{$assetId}] is not a caption");
             continue;
         }
         if ($asset->getStatus() == asset::ASSET_STATUS_READY) {
             $syncKey = $asset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
             if (kFileSyncUtils::fileSync_exists($syncKey)) {
                 $captionInfo = $this->getCaptionInfo($asset, $distributionJobData, KalturaDistributionAction::SUBMIT);
                 if ($captionInfo) {
                     $captionInfo->filePath = kFileSyncUtils::getLocalFilePathForKey($syncKey, false);
                     $this->captionsInfo[] = $captionInfo;
                 }
             }
         } elseif ($asset->getStatus() == asset::ASSET_STATUS_DELETED) {
             $captionInfo = $this->getCaptionInfo($asset, $distributionJobData, KalturaDistributionAction::DELETE);
             if ($captionInfo) {
                 $this->captionsInfo[] = $captionInfo;
             }
         } else {
             KalturaLog::err("Asset [{$assetId}] has status [" . $asset->getStatus() . "]. not added to provider data");
         }
     }
 }
开发者ID:dozernz,项目名称:server,代码行数:36,代码来源:KalturaFacebookDistributionJobProviderData.php

示例2: shouldConsumeJobStatusEvent

 public function shouldConsumeJobStatusEvent(BatchJob $dbBatchJob)
 {
     $jobType = $dbBatchJob->getJobType();
     $data = $dbBatchJob->getData();
     // copy cue points only if it's the first file and this is the primary server
     if ($jobType == BatchJobType::CONVERT_LIVE_SEGMENT && $dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FINISHED && $data->getFileIndex() == 0 && $data->getMediaServerIndex() == MediaServerIndex::PRIMARY) {
         $asset = assetPeer::retrieveByIdNoFilter($data->getAssetId());
         if ($asset->hasTag(assetParams::TAG_RECORDING_ANCHOR)) {
             return true;
         }
     } elseif ($jobType == BatchJobType::CONCAT && $dbBatchJob->getStatus() == BatchJob::BATCHJOB_STATUS_FINISHED) {
         $convertLiveSegmentJobData = $dbBatchJob->getParentJob()->getData();
         $asset = assetPeer::retrieveByIdNoFilter($convertLiveSegmentJobData->getAssetId());
         if ($asset->hasTag(assetParams::TAG_RECORDING_ANCHOR)) {
             return true;
         }
     }
     return false;
 }
开发者ID:dozernz,项目名称:server,代码行数:19,代码来源:kCuePointManager.php

示例3: addCaptionsData

 private function addCaptionsData(KalturaDistributionJobData $distributionJobData)
 {
     /* @var $mediaFile KalturaDistributionRemoteMediaFile */
     $assetIdsArray = explode(',', $distributionJobData->entryDistribution->assetIds);
     if (empty($assetIdsArray)) {
         return;
     }
     $assets = array();
     $this->captionsInfo = new KalturaDailymotionDistributionCaptionInfoArray();
     foreach ($assetIdsArray as $assetId) {
         $asset = assetPeer::retrieveByIdNoFilter($assetId);
         if (!$asset) {
             KalturaLog::err("Asset [{$assetId}] not found");
             continue;
         }
         if ($asset->getStatus() == asset::ASSET_STATUS_READY) {
             $assets[] = $asset;
         } elseif ($asset->getStatus() == asset::ASSET_STATUS_DELETED) {
             $captionInfo = new KalturaDailymotionDistributionCaptionInfo();
             $captionInfo->action = KalturaDailymotionDistributionCaptionAction::DELETE_ACTION;
             $captionInfo->assetId = $assetId;
             //getting the asset's remote id
             foreach ($distributionJobData->mediaFiles as $mediaFile) {
                 if ($mediaFile->assetId == $assetId) {
                     $captionInfo->remoteId = $mediaFile->remoteId;
                     $this->captionsInfo[] = $captionInfo;
                     break;
                 }
             }
         } else {
             KalturaLog::err("Asset [{$assetId}] has status [" . $asset->getStatus() . "]. not added to provider data");
         }
     }
     foreach ($assets as $asset) {
         $assetType = $asset->getType();
         switch ($assetType) {
             case CaptionPlugin::getAssetTypeCoreValue(CaptionAssetType::CAPTION):
                 $syncKey = $asset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
                 if (kFileSyncUtils::fileSync_exists($syncKey)) {
                     $captionInfo = $this->getCaptionInfo($asset, $syncKey, $distributionJobData);
                     if ($captionInfo) {
                         $captionInfo->language = $this->getLanguageCode($asset->getLanguage());
                         $captionInfo->format = $this->getCaptionFormat($asset);
                         if ($captionInfo->language) {
                             $this->captionsInfo[] = $captionInfo;
                         } else {
                             KalturaLog::err('The caption [' . $asset->getId() . '] has unrecognized language [' . $asset->getLanguage() . ']');
                         }
                     }
                 }
                 break;
             case AttachmentPlugin::getAssetTypeCoreValue(AttachmentAssetType::ATTACHMENT):
                 $syncKey = $asset->getSyncKey(asset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
                 if (kFileSyncUtils::fileSync_exists($syncKey)) {
                     $captionInfo = $this->getCaptionInfo($asset, $syncKey, $distributionJobData);
                     if ($captionInfo) {
                         //language code should be set in the attachments title
                         $captionInfo->language = $asset->getTitle();
                         $captionInfo->format = $this->getCaptionFormat($asset);
                         $languageCodeReflector = KalturaTypeReflectorCacher::get('KalturaLanguageCode');
                         //check if the language code exists
                         if ($languageCodeReflector && $languageCodeReflector->getConstantName($captionInfo->language)) {
                             $this->captionsInfo[] = $captionInfo;
                         } else {
                             KalturaLog::err('The attachment [' . $asset->getId() . '] has unrecognized language [' . $asset->getTitle() . ']');
                         }
                     }
                 }
                 break;
         }
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:72,代码来源:KalturaDailymotionDistributionJobProviderData.php

示例4: addMediaInfoAction

 /**
  * batch addMediaInfoAction action saves a media info object
  * 
  * @action addMediaInfo
  * @param KalturaMediaInfo $mediaInfo
  * @return KalturaMediaInfo 
  * @throws KalturaErrors::FLAVOR_ASSET_ID_NOT_FOUND
  */
 function addMediaInfoAction(KalturaMediaInfo $mediaInfo)
 {
     $mediaInfoDb = null;
     $flavorAsset = null;
     if ($mediaInfo->flavorAssetId) {
         $flavorAsset = assetPeer::retrieveByIdNoFilter($mediaInfo->flavorAssetId);
         if (!$flavorAsset) {
             throw new KalturaAPIException(KalturaErrors::FLAVOR_ASSET_ID_NOT_FOUND, $mediaInfo->flavorAssetId);
         }
         $mediaInfoDb = mediaInfoPeer::retrieveByFlavorAssetId($mediaInfo->flavorAssetId);
         if ($mediaInfoDb && $mediaInfoDb->getFlavorAssetVersion() == $flavorAsset->getVersion()) {
             $mediaInfoDb = $mediaInfo->toUpdatableObject($mediaInfoDb);
         } else {
             $mediaInfoDb = null;
         }
     }
     if (!$mediaInfoDb) {
         $mediaInfoDb = $mediaInfo->toInsertableObject();
     }
     if ($flavorAsset) {
         $mediaInfoDb->setFlavorAssetVersion($flavorAsset->getVersion());
     }
     $mediaInfoDb = kBatchManager::addMediaInfo($mediaInfoDb);
     $mediaInfo->fromObject($mediaInfoDb);
     return $mediaInfo;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:34,代码来源:BatchService.php

示例5: calculateId

 private function calculateId()
 {
     $dc = kDataCenterMgr::getCurrentDc();
     for ($i = 0; $i < 10; $i++) {
         $id = $dc["id"] . '_' . kString::generateStringId();
         $existingObject = assetPeer::retrieveByIdNoFilter($id);
         if ($existingObject) {
             KalturaLog::log(__METHOD__ . ": id [{$id}] already exists");
         } else {
             return $id;
         }
     }
     throw new Exception("Could not find unique id for flavorAsset");
 }
开发者ID:DBezemer,项目名称:server,代码行数:14,代码来源:asset.php

示例6: initPartnerByAssetId

 public static function initPartnerByAssetId($assetId)
 {
     KalturaCriterion::disableTags(array(KalturaCriterion::TAG_ENTITLEMENT_ENTRY, KalturaCriterion::TAG_WIDGET_SESSION));
     $asset = assetPeer::retrieveByIdNoFilter($assetId);
     KalturaCriterion::restoreTags(array(KalturaCriterion::TAG_ENTITLEMENT_ENTRY, KalturaCriterion::TAG_WIDGET_SESSION));
     if (!$asset) {
         return null;
     }
     kCurrentContext::$ks = null;
     kCurrentContext::$ks_object = null;
     kCurrentContext::$ks_hash = null;
     kCurrentContext::$ks_partner_id = $asset->getPartnerId();
     kCurrentContext::$ks_uid = null;
     kCurrentContext::$master_partner_id = null;
     kCurrentContext::$partner_id = $asset->getPartnerId();
     kCurrentContext::$uid = null;
     kCurrentContext::$is_admin_session = false;
     return $asset;
 }
开发者ID:AdiTal,项目名称:server,代码行数:19,代码来源:kCurrentContext.class.php

示例7: handleConcatFinished

 /**
  * @param BatchJob $dbBatchJob
  * @param kConcatJobData $data
  * @return BatchJob
  */
 public static function handleConcatFinished(BatchJob $dbBatchJob, kConcatJobData $data)
 {
     if ($dbBatchJob->getExecutionStatus() == BatchJobExecutionStatus::ABORTED) {
         return $dbBatchJob;
     }
     if (!file_exists($data->getDestFilePath())) {
         throw new APIException(APIErrors::INVALID_FILE_NAME, $data->getDestFilePath());
     }
     $flavorAsset = assetPeer::retrieveByIdNoFilter($data->getFlavorAssetId());
     if (!$flavorAsset) {
         throw new APIException(APIErrors::INVALID_FLAVOR_ASSET_ID, $data->getFlavorAssetId());
     }
     if ($flavorAsset->getStatus() == asset::ASSET_STATUS_DELETED) {
         return $dbBatchJob;
     }
     $flavorAsset->incrementVersion();
     $ext = pathinfo($data->getDestFilePath(), PATHINFO_EXTENSION);
     if ($ext) {
         $flavorAsset->setFileExt($ext);
     }
     $flavorAsset->save();
     $syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
     kFileSyncUtils::moveFromFile($data->getDestFilePath(), $syncKey);
     kEventsManager::raiseEvent(new kObjectAddedEvent($flavorAsset, $dbBatchJob));
     return $dbBatchJob;
 }
开发者ID:GElkayam,项目名称:server,代码行数:31,代码来源:kFlowHelper.php


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