r23369 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23368‎ | r23369 | r23370 >
Date:08:11, 25 June 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Suport for inequality queries on data values
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
@@ -617,7 +617,7 @@
618618 break;
619619 default: // fixed value, possibly with comparator addons
620620 // for now, treat comparators only if placed before whole value:
621 - $list = preg_split('/^(<|>)/',$value, 2, PREG_SPLIT_DELIM_CAPTURE);
 621+ $list = preg_split('/^(<|>|!)/',$value, 2, PREG_SPLIT_DELIM_CAPTURE);
622622 $comparator = SMW_CMP_EQ;
623623 if (count($list) == 3) { // initial comparator found ($list[1] should be empty)
624624 switch ($list[1]) {
@@ -629,6 +629,10 @@
630630 $comparator = SMW_CMP_GEQ;
631631 $value = $list[2];
632632 break;
 633+ case '!':
 634+ $comparator = SMW_CMP_NEQ;
 635+ $value = $list[2];
 636+ break;
633637 //default: not possible
634638 }
635639 }

Status & tagging log