本文整理匯總了PHP中kFileSyncUtils::retrieveObjectForFileSync方法的典型用法代碼示例。如果您正苦於以下問題:PHP kFileSyncUtils::retrieveObjectForFileSync方法的具體用法?PHP kFileSyncUtils::retrieveObjectForFileSync怎麽用?PHP kFileSyncUtils::retrieveObjectForFileSync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kFileSyncUtils
的用法示例。
在下文中一共展示了kFileSyncUtils::retrieveObjectForFileSync方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteObject
function deleteObject(FileSync $fileSync)
{
$object = kFileSyncUtils::retrieveObjectForFileSync($fileSync);
$key = $object->getSyncKey($fileSync->getObjectSubType());
if ($key->version != $fileSync->getVersion()) {
return;
}
switch ($fileSync->getObjectType()) {
case FileSyncObjectType::UICONF:
$object->setStatus(uiConf::UI_CONF_STATUS_DELETED);
$object->save();
break;
case FileSyncObjectType::ENTRY:
myEntryUtils::deleteEntry($object);
try {
$wrapper = objectWrapperBase::getWrapperClass($object);
$wrapper->removeFromCache("entry", $object->getId());
} catch (Exception $e) {
KalturaLog::err($e);
}
break;
case FileSyncObjectType::ASSET:
$object->setStatus(flavorAsset::FLAVOR_ASSET_STATUS_DELETED);
$object->setDeletedAt(time());
$object->save();
break;
case FileSyncObjectType::METADATA:
$object->setStatus(Metadata::STATUS_DELETED);
$object->save();
break;
default:
return;
}
if ($fileSync->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_LINK) {
return;
}
$criteria = new Criteria();
$criteria->add(FileSyncPeer::DC, $fileSync->getDc());
$criteria->add(FileSyncPeer::FILE_TYPE, FileSync::FILE_SYNC_FILE_TYPE_LINK);
$criteria->add(FileSyncPeer::LINKED_ID, $fileSync->getId());
$links = FileSyncPeer::doSelect($criteria);
foreach ($links as $link) {
deleteObject($link);
}
}
示例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: fileSyncCreated
/**
* @param BaseObject $object
*/
public function fileSyncCreated(FileSync $fileSync)
{
$object = kFileSyncUtils::retrieveObjectForFileSync($fileSync);
if (!$object || !$object instanceof ISyncableFile) {
KalturaLog::info("Not instance of ISyncableFile");
return;
}
$auditTrail = self::createAuditTrail($object, AuditTrail::AUDIT_TRAIL_ACTION_FILE_SYNC_CREATED);
if (!$auditTrail) {
KalturaLog::info("No audit created");
return;
}
$data = new kAuditTrailFileSyncCreateInfo();
$data->setVersion($fileSync->getVersion());
$data->setObjectSubType($fileSync->getObjectSubType());
$data->setDc($fileSync->getDc());
$data->setOriginal($fileSync->getOriginal());
$data->setFileType($fileSync->getFileType());
$auditTrail->setData($data);
$auditTrail->save();
}