r24078 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24077‎ | r24078 | r24079 >
Date:09:23, 14 July 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
updated type ids to use new id strings
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php
@@ -154,7 +154,6 @@
155155 }
156156 $db->freeResult($res);
157157 } else {
158 -
159158 if ($value instanceof SMWDataValue) {
160159 if ($value->getXSDValue() !== false) { // filters out error-values etc.
161160 $stringvalue = $value->getXSDValue();
@@ -196,7 +195,7 @@
197196
198197 $id = SMWDataValueFactory::getAttributeObjectTypeID($attribute);
199198 switch ($id) {
200 - case 'text': // long text attribute
 199+ case '_txt': // long text attribute
201200 $res = $db->select( $db->tableName('smw_longstrings'),
202201 'value_blob',
203202 'subject_id=' . $db->addQuotes($subject->getArticleID()) .
@@ -272,7 +271,7 @@
273272 $result = array();
274273 $id = SMWDataValueFactory::getAttributeObjectTypeID($attribute);
275274 switch ($id) {
276 - case 'text':
 275+ case '_txt':
277276 $res = $db->select( $db->tableName('smw_longstrings'),
278277 'DISTINCT subject_id',
279278 $sql, 'SMW::getAllAttributeSubjects',
@@ -483,7 +482,7 @@
484483 $attributeValueArray = $data->getAttributeValues($attribute);
485484 foreach($attributeValueArray as $value) {
486485 if ($value->isValid()) {
487 - if ($value->getTypeID() !== 'text') {
 486+ if ($value->getTypeID() !== '_txt') {
488487 $up_attributes[] =
489488 array( 'subject_id' => $subject->getArticleID(),
490489 'subject_namespace' => $subject->getNamespace(),
@@ -493,7 +492,7 @@
494493 'value_datatype' => $value->getTypeID(),
495494 'value_xsd' => $value->getXSDValue(),
496495 'value_num' => $value->getNumericValue() );
497 - } elseif ($value->getTypeID() !== 'text') { // f.k.a. "Relation"
 496+ } elseif ($value->getTypeID() !== '_wpg') { // f.k.a. "Relation"
498497 $up_relations[] =
499498 array( 'subject_id' => $subject->getArticleID(),
500499 'subject_namespace' => $subject->getNamespace(),
@@ -1176,7 +1175,7 @@
11771176 }
11781177 } elseif ($description instanceof SMWValueDescription) {
11791178 switch ($description->getDatavalue()->getTypeID()) {
1180 - case 'text': // actually this should not happen; we cannot do anything here
 1179+ case '_txt': // actually this should not happen; we cannot do anything here
11811180 break;
11821181 default:
11831182 if ( $this->addJoin('ATTS', $from, $db, $curtables) ) {
@@ -1255,7 +1254,7 @@
12561255 } elseif ($description instanceof SMWSomeAttribute) {
12571256 $id = SMWDataValueFactory::getAttributeObjectTypeID($description->getAttribute());
12581257 switch ($id) {
1259 - case 'text':
 1258+ case '_txt':
12601259 $table = 'TEXT';
12611260 $sub = false; //no recursion: we do not support further conditions on text-type values
12621261 break;

Status & tagging log