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


PHP BaseObject::getFileType方法代码示例

本文整理汇总了PHP中BaseObject::getFileType方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseObject::getFileType方法的具体用法?PHP BaseObject::getFileType怎么用?PHP BaseObject::getFileType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseObject的用法示例。


在下文中一共展示了BaseObject::getFileType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: objectAdded

 /**
  * @param BaseObject $object
  * @return bool true if should continue to the next consumer
  */
 public function objectAdded(BaseObject $object)
 {
     if (!$object instanceof FileSync || $object->getStatus() != FileSync::FILE_SYNC_STATUS_PENDING || $object->getFileType() != FileSync::FILE_SYNC_FILE_TYPE_FILE || $object->getDc() == kDataCenterMgr::getCurrentDcId()) {
         return true;
     }
     $c = new Criteria();
     $c->addAnd(FileSyncPeer::OBJECT_ID, $object->getObjectId());
     $c->addAnd(FileSyncPeer::VERSION, $object->getVersion());
     $c->addAnd(FileSyncPeer::OBJECT_TYPE, $object->getObjectType());
     $c->addAnd(FileSyncPeer::OBJECT_SUB_TYPE, $object->getObjectSubType());
     $c->addAnd(FileSyncPeer::ORIGINAL, '1');
     $original_filesync = FileSyncPeer::doSelectOne($c);
     if (!$original_filesync) {
         KalturaLog::err('Original filesync not found for object_id[' . $object->getObjectId() . '] version[' . $object->getVersion() . '] type[' . $object->getObjectType() . '] subtype[' . $object->getObjectSubType() . ']');
         return true;
     }
     $sourceFileUrl = $original_filesync->getExternalUrl();
     if (!$sourceFileUrl) {
         KalturaLog::err('External URL not found for filesync id [' . $object->getId() . ']');
         return true;
     }
     $job = kMultiCentersManager::addFileSyncImportJob($this->getEntryId($object), $object->getPartnerId(), $object->getId(), $sourceFileUrl);
     $job->setDc($object->getDc());
     $job->save();
     return true;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:30,代码来源:kMultiCentersSynchronizer.php

示例2: shouldConsumeAddedEvent

 public function shouldConsumeAddedEvent(BaseObject $object)
 {
     if ($object instanceof FileSync && $object->getStatus() == FileSync::FILE_SYNC_STATUS_PENDING && $object->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_FILE && $object->getDc() != kDataCenterMgr::getCurrentDcId() && $this->shouldSyncFileObjectType($object->getObjectType(), $object->getObjectSubType())) {
         return true;
     }
     return false;
 }
开发者ID:AdiTal,项目名称:server,代码行数:7,代码来源:kMultiCentersSynchronizer.php

示例3: shouldConsumeDeletedEvent

 /**
  * @param BaseObject $object
  * @return bool true if the consumer should handle the event
  */
 public function shouldConsumeDeletedEvent(BaseObject $object)
 {
     if ($object instanceof FileSync) {
         if ($object->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_URL) {
             $storage = StorageProfilePeer::retrieveByPK($object->getDc());
             KalturaLog::debug("storage auto delete policy: " . $storage->getAllowAutoDelete());
             if ($storage->getStatus() == StorageProfile::STORAGE_STATUS_AUTOMATIC && $storage->getAllowAutoDelete()) {
                 return true;
             }
             KalturaLog::debug('Unable to consume deleted event; storageProfile status is not equal to ' . StorageProfile::STORAGE_STATUS_AUTOMATIC);
         }
     }
     return false;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:18,代码来源:kStorageExporter.php

示例4: shouldConsumeDeletedEvent

 /**
  * @param BaseObject $object
  * @return bool true if the consumer should handle the event
  */
 public function shouldConsumeDeletedEvent(BaseObject $object)
 {
     if ($object instanceof FileSync) {
         if (!PermissionPeer::isValidForPartner(PermissionName::FEATURE_REMOTE_STORAGE, $object->getPartnerId())) {
             return false;
         }
         if ($object->getFileType() == FileSync::FILE_SYNC_FILE_TYPE_URL) {
             $storage = StorageProfilePeer::retrieveByPK($object->getDc());
             if ($storage->getStatus() == StorageProfile::STORAGE_STATUS_AUTOMATIC && $storage->getAllowAutoDelete()) {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:DBezemer,项目名称:server,代码行数:19,代码来源:kStorageExporter.php


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