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