當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。