当前位置: 首页>>代码示例>>PHP>>正文


PHP kFileSyncUtils::retrieveObjectForFileSync方法代码示例

本文整理汇总了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);
    }
}
开发者ID:DBezemer,项目名称:server,代码行数:45,代码来源:validateFileSyncs.php

示例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();
             }
         }
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:26,代码来源:KWAMSMediaInfoParser.php

示例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();
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:20,代码来源:kWAMS.php

示例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();
 }
开发者ID:DBezemer,项目名称:server,代码行数:24,代码来源:kAuditTrailManager.php


注:本文中的kFileSyncUtils::retrieveObjectForFileSync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。