本文整理匯總了PHP中FileSyncPeer::retrieveByWamsAssetId方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSyncPeer::retrieveByWamsAssetId方法的具體用法?PHP FileSyncPeer::retrieveByWamsAssetId怎麽用?PHP FileSyncPeer::retrieveByWamsAssetId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileSyncPeer
的用法示例。
在下文中一共展示了FileSyncPeer::retrieveByWamsAssetId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param string $srcWAMSAssetId
* @param string $targetPath
*/
public function __construct($srcWAMSAssetId, $targetPath)
{
KalturaLog::debug("Creation instance of KWAMSThumbnailMaker srcWAMSAssetId = [{$srcWAMSAssetId}] targetPath = [{$targetPath}]");
$this->srcWAMSAssetId = $srcWAMSAssetId;
$this->targetPath = $targetPath;
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
$fileSync = FileSyncPeer::retrieveByWamsAssetId($srcWAMSAssetId);
if (!empty($fileSync)) {
$this->partnerId = $fileSync->getPartnerId();
}
}
示例2: __construct
/**
* Creates instance of class and initializes properties
* @param string $type
* @param string $filePath
* @param KSchedularTaskConfig $taskConfig
*/
public function __construct($type, $filePath, KSchedularTaskConfig $taskConfig, KalturaBatchJob $job, $wamsAssetId)
{
$this->wamsAssetId = $wamsAssetId;
$this->filePath = $filePath;
$this->mediaInfoParser = parent::getParser($type, $filePath, $taskConfig, $job);
$this->partnerId = $job->partnerId;
DbManager::setConfig(kConf::getDB());
DbManager::initialize();
$fileSync = FileSyncPeer::retrieveByWamsAssetId($this->wamsAssetId);
if ($fileSync) {
$flavorAsset = kFileSyncUtils::retrieveObjectForFileSync($fileSync);
if ($flavorAsset instanceof asset) {
$this->originalMediaInfo = mediaInfoPeer::retrieveOriginalByEntryId($flavorAsset->getEntryId());
$entry = $flavorAsset->getentry();
if ($entry) {
$this->mediaType = $entry->getMediaType();
}
}
}
}
示例3: getEntryName
private function getEntryName($assetId)
{
$fileSync = FileSyncPeer::retrieveByWamsAssetId($assetId);
if (!$fileSync) {
return null;
}
$asset = kFileSyncUtils::retrieveObjectForFileSync($fileSync);
if (!$asset) {
return null;
}
$entry = $asset->getentry();
if (!$entry) {
return null;
}
$replacedId = $entry->getReplacedEntryId();
if (!empty($replacedId)) {
$entry = entryPeer::retrieveByPK($replacedId);
}
return $entry->getName();
}
示例4: dumpFile
private function dumpFile($file_path, $file_name, $wams_asset_id = null, $wams_url = null)
{
$relocate = $this->getRequestParameter("relocate");
$directServe = $this->getRequestParameter("direct_serve");
if (!$relocate) {
$url = $_SERVER["REQUEST_URI"];
if (strpos($url, "?") !== false) {
$url .= "&relocate=";
} else {
$url .= "/relocate/";
}
$url .= $this->encodeUrl($file_name);
kFile::cacheRedirect($url);
header("Location: {$url}");
die;
} else {
if (!$directServe) {
header("Content-Disposition: attachment; filename=\"{$file_name}\"");
}
if (!empty($wams_asset_id)) {
$fileSync = FileSyncPeer::retrieveByWamsAssetId($wams_asset_id);
kWAMS::getInstance($fileSync->getPartnerId())->dumpFile($wams_asset_id, pathinfo($file_name, PATHINFO_EXTENSION));
} else {
$mime_type = kFile::mimeType($file_path);
kFile::dumpFile($file_path, $mime_type);
}
}
}