本文整理汇总了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();
}