本文整理匯總了PHP中FileSyncPeer::retrieveByFileSyncKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSyncPeer::retrieveByFileSyncKey方法的具體用法?PHP FileSyncPeer::retrieveByFileSyncKey怎麽用?PHP FileSyncPeer::retrieveByFileSyncKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileSyncPeer
的用法示例。
在下文中一共展示了FileSyncPeer::retrieveByFileSyncKey方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: toObject
public function toObject($object_to_fill = null, $props_to_skip = array())
{
$object = parent::toObject($object_to_fill, $props_to_skip);
$entryId = $object->getEntryId();
$entry = entryPeer::retrieveByPK($entryId);
$partnerId = $entry->getPartnerId();
$transcriptId = $object->getInputTranscriptId();
$voicebaseOptionsObj = VoicebasePlugin::getPartnerVoicebaseOptions($partnerId);
$object->setApiKey($voicebaseOptionsObj->apiKey);
$object->setApiPassword($voicebaseOptionsObj->apiPassword);
if (!$object->getFlavorAssetId()) {
$sourceAsset = assetPeer::retrieveOriginalReadyByEntryId($entryId);
if (!$sourceAsset) {
throw new KalturaAPIException(KalturaVoicebaseErrors::NO_FLAVOR_ASSET_FOUND, $entryId);
}
$object->setFlavorAssetId($sourceAsset->getId());
}
$voicebaseParamsMap = kConf::get('voicebase', 'integration');
if (!$object->getSpokenLanguage()) {
$object->setSpokenLanguage($voicebaseParamsMap['default_language']);
}
$formatsString = $object->getCaptionAssetFormats();
if ($formatsString) {
$formatsArray = explode(',', $formatsString);
$excludedFormats = $voicebaseParamsMap['exclude_formats'];
$sanitizedFormatsArray = array();
foreach ($formatsArray as $format) {
$format = preg_replace("/[^A-Z_]/", "", $format);
if (!constant("KalturaCaptionType::" . $format) || in_array($format, $excludedFormats)) {
throw new KalturaAPIException(KalturaVoicebaseErrors::INVALID_TYPES, $formatsString);
}
$sanitizedFormatsArray[] = $format;
}
$sanitizedFormats = implode(",", $sanitizedFormatsArray);
$object->setCaptionAssetFormats($sanitizedFormats);
} else {
$defaultFormats = implode(",", $voicebaseParamsMap['default_formats']);
$object->setCaptionAssetFormats($defaultFormats);
}
if ($transcriptId) {
$transcript = assetPeer::retrieveById($transcriptId);
$key = $transcript->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
$fileSync = FileSyncPeer::retrieveByFileSyncKey($key, true);
$object->setFileLocation($fileSync->getFullPath());
}
return $object;
}
示例2: deleteSyncFileForKey
/**
* mark file as deleted, return deleted version
* @param FileSyncKey $key
* @param bool $strict
* @param bool $fromKalturaDcsOnly
* @return string
*/
public static function deleteSyncFileForKey(FileSyncKey $key, $strict = false, $fromKalturaDcsOnly = false)
{
if (!$key) {
if ($strict) {
throw new Exception("Empty key");
}
return null;
}
// first check if fileSync is source or link
$file = FileSyncPeer::retrieveByFileSyncKey($key);
if (!$file) {
return null;
}
if ($file->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_LINK) {
$newStatus = FileSync::FILE_SYNC_STATUS_PURGED;
} elseif ($file->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_URL) {
$newStatus = FileSync::FILE_SYNC_STATUS_DELETED;
} else {
if ($file->getLinkCount() == 0) {
$newStatus = FileSync::FILE_SYNC_STATUS_DELETED;
} else {
$newStatus = FileSync::FILE_SYNC_STATUS_PURGED;
self::convertLinksToFiles($key);
}
}
$c = new Criteria();
$c = FileSyncPeer::getCriteriaForFileSyncKey($key);
if ($fromKalturaDcsOnly) {
$c->add(FileSyncPeer::FILE_TYPE, FileSync::FILE_SYNC_FILE_TYPE_URL, Criteria::NOT_EQUAL);
}
$file_sync_list = FileSyncPeer::doSelect($c);
foreach ($file_sync_list as $file_sync) {
$wams_asset_id = $file_sync->getWamsAssetId();
if (!empty($wams_asset_id)) {
if ($newStatus == FileSync::FILE_SYNC_STATUS_DELETED) {
self::clearWAMSDataForKey($key, $strict);
} else {
$file_sync->setWamsAssetId(null);
$file_sync->setWamsUrl(null);
}
}
$file_sync->setFileSize('0');
$file_sync->setStatus($newStatus);
$file_sync->save();
}
}
示例3: handleDeleteFileFinished
/**
* @param BatchJob $dbBatchJob
* @param kConvertCollectionJobData $data
* @return BatchJob
*/
public static function handleDeleteFileFinished(BatchJob $dbBatchJob, kDeleteFileJobData $data)
{
KalturaLog::debug("File delete finished for file path: " . $data->getLocalFileSyncPath() . ", data center: " . $dbBatchJob->getDc());
//Change status of the filesync to "purged"
FileSyncPeer::setUseCriteriaFilter(false);
$fileSyncFroDeletedFile = FileSyncPeer::retrieveByFileSyncKey($data->getSyncKey(), true);
FileSyncPeer::setUseCriteriaFilter(true);
$fileSyncFroDeletedFile->setStatus(FileSync::FILE_SYNC_STATUS_PURGED);
$fileSyncFroDeletedFile->save();
return $dbBatchJob;
}
示例4: handleDeleteFileFinished
/**
* @param BatchJob $dbBatchJob
* @param kConvertCollectionJobData $data
* @return BatchJob
*/
public static function handleDeleteFileFinished(BatchJob $dbBatchJob, kDeleteFileJobData $data)
{
//Change status of the filesync to "purged"
FileSyncPeer::setUseCriteriaFilter(false);
$fileSyncFroDeletedFile = FileSyncPeer::retrieveByFileSyncKey($data->getSyncKey(), true);
FileSyncPeer::setUseCriteriaFilter(true);
$fileSyncFroDeletedFile->setStatus(FileSync::FILE_SYNC_STATUS_PURGED);
$fileSyncFroDeletedFile->save();
return $dbBatchJob;
}
示例5: toObject
public function toObject($object_to_fill = null, $props_to_skip = array())
{
$object = parent::toObject($object_to_fill, $props_to_skip);
$entryId = $object->getEntryId();
$entry = entryPeer::retrieveByPK($entryId);
$partnerId = $entry->getPartnerId();
$transcriptId = $object->getInputTranscriptId();
$voicebaseOptionsObj = VoicebasePlugin::getPartnerVoicebaseOptions($partnerId);
$object->setApiKey($voicebaseOptionsObj->apiKey);
$object->setApiPassword($voicebaseOptionsObj->apiPassword);
if ($transcriptId) {
$transcript = assetPeer::retrieveById($transcriptId);
$key = $transcript->getSyncKey(asset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
$fileSync = FileSyncPeer::retrieveByFileSyncKey($key, true);
$object->setFileLocation($fileSync->getFullPath());
}
return $object;
}