本文整理汇总了PHP中StorageProfilePeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP StorageProfilePeer::retrieveByPK方法的具体用法?PHP StorageProfilePeer::retrieveByPK怎么用?PHP StorageProfilePeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StorageProfilePeer
的用法示例。
在下文中一共展示了StorageProfilePeer::retrieveByPK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStorageProfile
protected static function getStorageProfile($storageProfileId = null)
{
if (is_null($storageProfileId)) {
return kDataCenterMgr::getCurrentStorageProfile();
}
return StorageProfilePeer::retrieveByPK($storageProfileId);
}
示例2: getTokenizer
/**
* @return kUrlTokenizer
*/
public function getTokenizer()
{
$secret = null;
switch ($this->protocol) {
case StorageProfile::PLAY_FORMAT_HTTP:
if (@$this->params['http_auth_salt']) {
$storageProfile = StorageProfilePeer::retrieveByPK($this->storageProfileId);
if ($storageProfile) {
// get parameters
$window = $this->params['http_auth_seconds'];
$secret = $this->params['http_auth_salt'];
$useDummyHost = false;
$httpBaseUrl = rtrim($storageProfile->getDeliveryHttpBaseUrl(), '/');
}
}
break;
case StorageProfile::PLAY_FORMAT_RTMP:
if (@$this->params['rtmp_auth_salt']) {
$window = $this->params['rtmp_auth_seconds'];
$secret = $this->params['rtmp_auth_salt'];
$useDummyHost = true;
$httpBaseUrl = '';
}
break;
}
if ($secret) {
if (is_null($window) || !is_int($window)) {
$window = self::DEFAULT_ACCESS_WINDOW_SECONDS;
}
return new kMirrorImageUrlTokenizer($window, $secret, $useDummyHost, $httpBaseUrl);
}
return null;
}
示例3: getCurrentStorageProfile
/**
* @return StorageProfile
*/
public static function getCurrentStorageProfile()
{
if (self::$currentStorageProfile) {
return self::$currentStorageProfile;
}
self::$currentStorageProfile = StorageProfilePeer::retrieveByPK(self::getCurrentDcId());
return self::$currentStorageProfile;
}
示例4: validateForUsage
public function validateForUsage($sourceObject, $propertiesToSkip = array())
{
parent::validateForUsage($sourceObject, $propertiesToSkip);
$this->validatePropertyNotNull('storageProfileId');
$storageProfile = StorageProfilePeer::retrieveByPK($this->storageProfileId);
if (!$storageProfile) {
throw new KalturaAPIException(KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND, $this->storageProfileId);
}
}
示例5: validateEntry
public function validateEntry(entry $dbEntry)
{
parent::validateEntry($dbEntry);
$this->validatePropertyNotNull('storageProfileId');
$storageProfile = StorageProfilePeer::retrieveByPK($this->storageProfileId);
if (!$storageProfile) {
throw new KalturaAPIException(KalturaErrors::STORAGE_PROFILE_ID_NOT_FOUND, $this->storageProfileId);
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:9,代码来源:KalturaRemoteStorageResource.php
示例6: getUrlManagerByStorageProfile
/**
* @param int $storageProfileId
* @return kUrlManager
*/
public static function getUrlManagerByStorageProfile($storageProfileId)
{
$class = 'kUrlManager';
$storageProfile = StorageProfilePeer::retrieveByPK($storageProfileId);
if ($storageProfile && $storageProfile->getUrlManagerClass() && class_exists($storageProfile->getUrlManagerClass())) {
$class = $storageProfile->getUrlManagerClass();
}
KalturaLog::log("Uses url manager [{$class}]");
return new $class($storageProfileId);
}
示例7: doGetFileSyncUrl
protected function doGetFileSyncUrl(FileSync $fileSync)
{
$storageProfile = StorageProfilePeer::retrieveByPK($this->params->getStorageId());
/* @var $storageProfile KontikiStorageProfile */
$kontikiAPIWrapper = new KontikiAPIWrapper($storageProfile->getStorageUrl());
$playbackResource = $kontikiAPIWrapper->getPlaybackResource(KontikiPlugin::SERVICE_TOKEN_PREFIX . base64_encode($storageProfile->getServiceToken()), $fileSync->getFilePath());
if (!$playbackResource) {
return null;
}
return strval($playbackResource->urn) . ";realmId:" . strval($playbackResource->realmId) . ";realmTicket:" . strval($playbackResource->realmTicket);
}
示例8: updateAction
/**
* Update storage profile by id
*
* @action update
* @param int $storageProfileId
* @param KalturaStorageProfile $storageProfile
* @return KalturaStorageProfile
*/
function updateAction($storageProfileId, KalturaStorageProfile $storageProfile)
{
$dbStorageProfile = StorageProfilePeer::retrieveByPK($storageProfileId);
if (!$dbStorageProfile) {
throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $storageProfileId);
}
$dbStorageProfile = $storageProfile->toUpdatableObject($dbStorageProfile);
$dbStorageProfile->save();
$storageProfile->fromObject($dbStorageProfile);
return $storageProfile;
}
示例9: updateAction
/**
* Update storage profile by id
*
* @action update
* @param int $storageProfileId
* @param KalturaStorageProfile $storageProfile
* @return KalturaStorageProfile
*/
function updateAction($storageProfileId, KalturaStorageProfile $storageProfile)
{
$dbStorageProfile = StorageProfilePeer::retrieveByPK($storageProfileId);
if (!$dbStorageProfile) {
throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $storageProfileId);
}
$dbStorageProfile = $storageProfile->toUpdatableObject($dbStorageProfile);
$dbStorageProfile->save();
$protocol = $dbStorageProfile->getProtocol();
$storageProfile = KalturaStorageProfile::getInstanceByType($protocol);
$storageProfile->fromObject($dbStorageProfile, $this->getResponseProfile());
return $storageProfile;
}
示例10: getExternalUrl
public function getExternalUrl($entryId, $format = PlaybackProtocol::HTTP)
{
$storage = StorageProfilePeer::retrieveByPK($this->getDc());
if (!$storage || $storage->getProtocol() == StorageProfile::STORAGE_KALTURA_DC) {
return kDataCenterMgr::getInternalRemoteUrl($this);
}
$urlManager = DeliveryProfilePeer::getRemoteDeliveryByStorageId(DeliveryProfileDynamicAttributes::init($this->getDc(), $entryId, PlaybackProtocol::HTTP, infraRequestUtils::getProtocol()));
if (is_null($urlManager) && infraRequestUtils::getProtocol() != 'http') {
$urlManager = DeliveryProfilePeer::getRemoteDeliveryByStorageId(DeliveryProfileDynamicAttributes::init($this->getDc(), $entryId));
}
if (is_null($urlManager)) {
return null;
}
$url = $urlManager->getFileSyncUrl($this);
$baseUrl = $urlManager->getUrl();
$url = ltrim($url, "/");
if (strpos($url, "://") === false) {
$url = rtrim($baseUrl, "/") . "/" . $url;
}
return $url;
}
示例11: doGetFileSyncUrl
protected function doGetFileSyncUrl(FileSync $fileSync)
{
$storage = StorageProfilePeer::retrieveByPK($fileSync->getDc());
if (!$storage) {
return parent::doGetFileSyncUrl($fileSync);
}
$partnerPath = myPartnerUtils::getUrlForPartner($fileSync->getPartnerId(), $fileSync->getPartnerId() * 100);
$objectSubType = $fileSync->getObjectSubType();
if ($fileSync->getObjectType() == FileSyncObjectType::ENTRY && $objectSubType == entry::FILE_SYNC_ENTRY_SUB_TYPE_ISM) {
return $this->doGetServeIsmUrl($fileSync, $partnerPath, $storage);
}
//To Remove - Until the migration process from asset sub type 3 to asset sub type 1 will be completed we need to support both formats
if ($fileSync->getObjectType() == FileSyncObjectType::FLAVOR_ASSET && $objectSubType == flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ISM) {
return $this->doGetServeIsmUrl($fileSync, $partnerPath, $storage);
}
if ($fileSync->getObjectType() == FileSyncObjectType::FLAVOR_ASSET && $objectSubType == flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET) {
$asset = assetPeer::retrieveById($fileSync->getObjectId());
if ($asset->hasTag(assetParams::TAG_ISM_MANIFEST)) {
return $this->doGetServeIsmUrl($fileSync, $partnerPath, $storage);
}
}
return parent::doGetFileSyncUrl($fileSync);
}
示例12: setDeliveryId
/**
* Parameters
* --------------
*/
function setDeliveryId($partnerId, $storageId, $deliveryIds)
{
// don't add to database if one of the parameters is missing or is an empty string
if (!$partnerId && !$storageId || !$deliveryIds) {
die('Missing parameter');
}
if ($partnerId) {
$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner) {
die("No such partner with id [{$partnerId}]." . PHP_EOL);
}
$partner->setDeliveryProfileIds($deliveryIds);
$partner->save();
}
if ($storageId) {
$storage = StorageProfilePeer::retrieveByPK($storageId);
if (!$storageId) {
die("No such storage profile with id [{$storageId}]." . PHP_EOL);
}
$storage->setDeliveryProfileIds($deliveryIds);
$storage->save();
}
}
示例13: initStorageProfile
public function initStorageProfile()
{
if (!$this->deliveryAttributes->getStorageId()) {
return;
}
$storageProfile = StorageProfilePeer::retrieveByPK($this->deliveryAttributes->getStorageId());
if (!$storageProfile) {
KExternalErrors::dieGracefully();
}
// TODO use a dieError
// storage doesn't belong to the partner
if ($storageProfile->getPartnerId() != $this->entry->getPartnerId()) {
KExternalErrors::dieGracefully();
}
// TODO use a dieError
}
示例14: handleAdditionalFilesConvertFinished
/**
*
* Allows to create additional files in the conversion process in addition to flavor asset
*/
private static function handleAdditionalFilesConvertFinished(flavorAsset $flavorAsset, BatchJob $dbBatchJob, kConvertJobData $data)
{
if (!$flavorAsset->getVersion() || !kFileSyncUtils::fileSync_exists($flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET))) {
$flavorAsset->incrementVersion();
$flavorAsset->save();
}
foreach ($data->getExtraDestFileSyncs() as $destFileSyncDesc) {
$syncKey = $flavorAsset->getSyncKey($destFileSyncDesc->getFileSyncObjectSubType());
$flavorParamsOutput = $data->getFlavorParamsOutput();
$storageProfileId = $flavorParamsOutput->getSourceRemoteStorageProfileId();
if ($storageProfileId == StorageProfile::STORAGE_KALTURA_DC) {
kFileSyncUtils::moveFromFile($destFileSyncDesc->getFileSyncLocalPath(), $syncKey, false);
} elseif ($flavorParamsOutput->getRemoteStorageProfileIds()) {
$remoteStorageProfileIds = explode(',', $flavorParamsOutput->getRemoteStorageProfileIds());
foreach ($remoteStorageProfileIds as $remoteStorageProfileId) {
$storageProfile = StorageProfilePeer::retrieveByPK($remoteStorageProfileId);
kFileSyncUtils::createReadyExternalSyncFileForKey($syncKey, $destFileSyncDesc->getFileSyncLocalPath(), $storageProfile);
}
}
}
}
示例15: getExternalStorageUrl
private function getExternalStorageUrl(Partner $partner, flavorAsset $flavorAsset, FileSyncKey $key)
{
if (!$partner->getStorageServePriority() || $partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_ONLY) {
return null;
}
if ($partner->getStorageServePriority() == StorageProfile::STORAGE_SERVE_PRIORITY_KALTURA_FIRST) {
if (kFileSyncUtils::getReadyInternalFileSyncForKey($key)) {
// check if having file sync on kaltura dcs
return null;
}
}
$fileSync = kFileSyncUtils::getReadyExternalFileSyncForKey($key);
if (!$fileSync) {
return null;
}
$storage = StorageProfilePeer::retrieveByPK($fileSync->getDc());
if (!$storage) {
return null;
}
$urlManager = kUrlManager::getUrlManagerByStorageProfile($fileSync->getDc(), $flavorAsset->getEntryId());
$urlManager->setFileExtension($flavorAsset->getFileExt());
$url = $storage->getDeliveryHttpBaseUrl() . '/' . $urlManager->getFileSyncUrl($fileSync);
return $url;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:24,代码来源:KalturaSyndicationFeedRenderer.php