function getUpdatedTranslatedTextPropertyRecordSet( $transactionId ) { $o = OmegaWikiAttributes::getInstance(); $dc = wdGetDataSetContext(); $dbr = wfGetDB( DB_SLAVE ); $queryResult = $dbr->query( "SELECT value_id, object_id, attribute_mid, value_tcid, " . getOperationSelectColumn( "{$dc}_translated_content_attribute_values", $transactionId ) . ', ' . getIsLatestSelectColumn( "{$dc}_translated_content_attribute_values", array( 'value_id' ), $transactionId ) . " FROM {$dc}_translated_content_attribute_values " . " WHERE " . getInTransactionRestriction( "{$dc}_translated_content_attribute_values", $transactionId ) ); $recordSet = new ArrayRecordSet( $o->updatedTranslatedTextPropertyStructure, new Structure( $o->valueId ) ); while ( $row = $dbr->fetchObject( $queryResult ) ) { $record = new ArrayRecord( $o->updatedTranslatedTextPropertyStructure ); $record->valueId = $row->value_id; $record->objectId = $row->object_id; $record->translatedContentId = $row->value_tcid; $record->attribute = getDefinedMeaningReferenceRecord( $row->attribute_mid ); $record->operation = $row->operation; $record->isLatest = $row->is_latest; $record->rollBack = simpleRecord( $o->rollBackStructure, array( $row->is_latest, $row->operation ) ); $recordSet->add( $record ); } $viewInformation = new ViewInformation(); $viewInformation->queryTransactionInformation = new QueryLatestTransactionInformation(); expandTranslatedContentsInRecordSet( $recordSet, $o->translatedContentId, $o->translatedTextText, $viewInformation ); return $recordSet; }
function getTranslatedTextAttributeValuesRecordSet( array $objectIds, ViewInformation $viewInformation ) { global $dataSet; $o = OmegaWikiAttributes::getInstance(); $recordSet = queryRecordSet( $o->translatedTextAttributeValuesStructure->getStructureType(), $viewInformation->queryTransactionInformation, $o->translatedTextAttributeId, new TableColumnsToAttributesMapping( new TableColumnsToAttribute( array( 'value_id' ), $o->translatedTextAttributeId ), new TableColumnsToAttribute( array( 'object_id' ), $o->attributeObject ), new TableColumnsToAttribute( array( 'attribute_mid' ), $o->translatedTextAttribute ), new TableColumnsToAttribute( array( 'value_tcid' ), $o->translatedTextValueId ) ), $dataSet->translatedContentAttributeValues, array( "object_id IN (" . implode( ", ", $objectIds ) . ")" ) ); $recordSet->getStructure()->addAttribute( $o->translatedTextValue ); expandTranslatedContentsInRecordSet( $recordSet, $o->translatedTextValueId, $o->translatedTextValue, $viewInformation ); expandDefinedMeaningReferencesInRecordSet( $recordSet, array( $o->translatedTextAttribute ) ); expandObjectAttributesAttribute( $recordSet, $o->objectAttributes, $o->translatedTextAttributeId, $viewInformation ); return $recordSet; }