Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -66,7 +66,7 @@ |
67 | 67 | /** Local collection of error strings, passed on to callers if possible. */ |
68 | 68 | protected $m_errors = array(); |
69 | 69 | |
70 | | - public function __construct( &$parentstore, &$dbslave ) { |
| 70 | + public function __construct( &$parentstore, DatabaseBase &$dbslave ) { |
71 | 71 | $this->m_store = $parentstore; |
72 | 72 | $this->m_dbs = $dbslave; |
73 | 73 | } |
— | — | @@ -593,7 +593,7 @@ |
594 | 594 | * SMWValueDescription objects, create and return a plain WHERE condition |
595 | 595 | * string for it. |
596 | 596 | */ |
597 | | - protected function compileAttributeWhere( $query, SMWDescription $description, $proptable, $valueindex, $operator = 'AND' ) { |
| 597 | + protected function compileAttributeWhere( $query, SMWDescription $description, SMWSQLStore2Table $proptable, $valueindex, $operator = 'AND' ) { |
598 | 598 | $where = ''; |
599 | 599 | if ( $description instanceof SMWValueDescription ) { |
600 | 600 | $dv = $description->getDatavalue(); |
— | — | @@ -610,15 +610,9 @@ |
611 | 611 | case SMW_CMP_LEQ: $comp = '<='; break; |
612 | 612 | case SMW_CMP_GEQ: $comp = '>='; break; |
613 | 613 | case SMW_CMP_NEQ: $comp = '!='; break; |
614 | | - case SMW_CMP_LIKE: |
615 | | - // TODO: explicitly excluding _geo here is a temporary workaround. Future versions will use personalised comparators for extensions and not LIKE (requires synchronisation with SemanticMaps to work) |
616 | | - if ( ( $dv->getTypeID() != '_geo' ) && ( ( $fieldtype == 't' ) || ( $fieldtype == 'l' ) ) ) { // string data allows pattern matches |
617 | | - $comp = ' LIKE '; |
618 | | - $value = str_replace( array( '%', '_', '*', '?' ), array( '\%', '\_', '%', '_' ), $value ); // translate pattern |
619 | | - } |
620 | | - break; |
621 | 614 | } |
622 | | - if ( $comp == '' ) { // allow extensions to define their own query conditions |
| 615 | + if ( $comp == '' ) { // Allow extensions to define their own query conditions. |
| 616 | + // FIXME: only one fieldname is passed, which won't work when multiple fields are needed. |
623 | 617 | wfRunHooks( 'smwGetSQLConditionForValue', array( &$where, $description, $query->alias, $fieldname, $this->m_dbs ) ); |
624 | 618 | } else { |
625 | 619 | $where = "{$query->alias}.{$fieldname}{$comp}" . $this->m_dbs->addQuotes( $value ); |