本文整理汇总了PHP中assetPeer::retrieveByFileSync方法的典型用法代码示例。如果您正苦于以下问题:PHP assetPeer::retrieveByFileSync方法的具体用法?PHP assetPeer::retrieveByFileSync怎么用?PHP assetPeer::retrieveByFileSync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assetPeer
的用法示例。
在下文中一共展示了assetPeer::retrieveByFileSync方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatedJob
public function updatedJob(BatchJob $dbBatchJob)
{
switch ($dbBatchJob->getStatus()) {
case BatchJob::BATCHJOB_STATUS_FINISHED:
$data = $dbBatchJob->getData();
$kontikiFileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId());
/* @var $data kStorageExportJobData */
$asset = assetPeer::retrieveByFileSync($kontikiFileSync);
$asset->setTags(KontikiPlugin::KONTIKI_ASSET_TAG);
$asset->save();
//Get Kontiki file sync and set the external URL
$kontikiFileSync->setFileRoot("");
$kontikiFileSync->setFilePath($data->getContentMoid());
$kontikiFileSync->save();
break;
}
return true;
}
示例2: handleStorageExportFailed
/**
* @param BatchJob $dbBatchJob
* @param kStorageExportJobData $data
* @return BatchJob
*/
public static function handleStorageExportFailed(BatchJob $dbBatchJob, kStorageExportJobData $data)
{
if ($dbBatchJob->getErrType() == BatchJobErrorTypes::APP && $dbBatchJob->getErrNumber() == BatchJobAppErrors::FILE_ALREADY_EXISTS) {
KalturaLog::notice("remote file already exists");
return $dbBatchJob;
}
$fileSync = FileSyncPeer::retrieveByPK($data->getSrcFileSyncId());
if (!$fileSync) {
KalturaLog::err("FileSync [" . $data->getSrcFileSyncId() . "] not found");
return $dbBatchJob;
}
$fileSync->setStatus(FileSync::FILE_SYNC_STATUS_ERROR);
$fileSync->save();
// if an asset was exported - check if should set its status to ERROR
$asset = assetPeer::retrieveByFileSync($fileSync);
if ($asset && $asset->getStatus() == asset::ASSET_STATUS_EXPORTING) {
$asset->setStatus(asset::ASSET_STATUS_ERROR);
$asset->save();
if ($asset instanceof flavorAsset) {
$flavorParamsOutput = $asset->getFlavorParamsOutput();
$flavorParamsOutputId = $flavorParamsOutput ? $flavorParamsOutput->getId() : null;
$mediaInfo = mediaInfoPeer::retrieveByFlavorAssetId($asset->getId());
$mediaInfoId = $mediaInfo ? $mediaInfo->getId() : null;
kBusinessPostConvertDL::handleConvertFailed($dbBatchJob, null, $asset->getId(), $flavorParamsOutputId, $mediaInfoId);
}
}
return $dbBatchJob;
}