本文整理汇总了PHP中BaseObject::getObjectType方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseObject::getObjectType方法的具体用法?PHP BaseObject::getObjectType怎么用?PHP BaseObject::getObjectType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::getObjectType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setRelatedObject
/**
* @param BaseObject $object
*/
protected function setRelatedObject(AuditTrail $auditTrail, BaseObject $object)
{
if (class_exists('Metadata') && $object instanceof Metadata) {
$auditTrail->setRelatedObjectType(AuditTrailObjectType::METADATA_PROFILE);
$auditTrail->setRelatedObjectId($object->getMetadataProfileId());
}
if ($auditTrail->getAction() == AuditTrail::AUDIT_TRAIL_ACTION_FILE_SYNC_CREATED) {
$peer = $object->getPeer();
$objectType = $peer->getOMClass(false, null);
$auditTrail->setRelatedObjectType($objectType);
$auditTrail->setRelatedObjectId($object->getId());
}
if ($object instanceof FileSync) {
switch ($object->getObjectType()) {
case FileSyncObjectType::ENTRY:
$auditTrail->setRelatedObjectType(AuditTrailObjectType::ENTRY);
$auditTrail->setRelatedObjectId($object->getObjectId());
$auditTrail->setEntryId($object->getObjectId());
break;
case FileSyncObjectType::UICONF:
$auditTrail->setRelatedObjectType(AuditTrailObjectType::UI_CONF);
$auditTrail->setRelatedObjectId($object->getObjectId());
break;
case FileSyncObjectType::BATCHJOB:
$auditTrail->setRelatedObjectType(AuditTrailObjectType::BATCH_JOB);
$auditTrail->setRelatedObjectId($object->getObjectId());
$batchJob = BatchJobPeer::retrieveByPK($object->getObjectId());
if ($batchJob) {
$auditTrail->setEntryId($batchJob->getEntryId());
}
break;
case FileSyncObjectType::FLAVOR_ASSET:
$auditTrail->setRelatedObjectType(AuditTrailObjectType::FLAVOR_ASSET);
$auditTrail->setRelatedObjectId($object->getObjectId());
$flavorAsset = assetPeer::retrieveById($object->getObjectId());
if ($flavorAsset) {
$auditTrail->setEntryId($flavorAsset->getEntryId());
}
break;
case FileSyncObjectType::METADATA:
$auditTrail->setRelatedObjectType(AuditTrailObjectType::METADATA);
$auditTrail->setRelatedObjectId($object->getObjectId());
if (class_exists('Metadata')) {
$metadata = MetadataPeer::retrieveByPK($object->getObjectId());
if ($metadata && $metadata->getObjectType() == MetadataObjectType::ENTRY) {
$auditTrail->setEntryId($metadata->getObjectId());
}
}
break;
case FileSyncObjectType::METADATA_PROFILE:
$auditTrail->setRelatedObjectType(AuditTrailObjectType::METADATA_PROFILE);
$auditTrail->setRelatedObjectId($object->getObjectId());
break;
}
}
}
示例3: objectAdded
public function objectAdded(BaseObject $object, BatchJob $raisedJob = null)
{
$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;
}
$entryId = $this->getEntryId($object);
$sourceFileUrl = $original_filesync->getExternalUrl($entryId);
if (!$sourceFileUrl) {
KalturaLog::err('External URL not found for filesync id [' . $object->getId() . ']');
return true;
}
$job = kMultiCentersManager::addFileSyncImportJob($entryId, $object, $sourceFileUrl, $raisedJob, $original_filesync->getFileSize());
$job->save();
return true;
}