r66314 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66313‎ | r66314 | r66315 >
Date:22:38, 12 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r66313
Modified paths:
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_AreaValueDescription.php (modified) (history)
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php (modified) (history)
  • /trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValueDescription.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValue.php
@@ -248,21 +248,21 @@
249249 }
250250
251251 /**
252 - * @see SMWDataValue::getValueIndexes
 252+ * @see SMWDataValue::getValueIndex
253253 *
254 - * @return array
 254+ * @return integer
255255 */
256 - public function getValueIndexes() {
257 - return array( 0, 1 );
 256+ public function getValueIndex() {
 257+ return 0;
258258 }
259259
260260 /**
261 - * @see SMWDataValue::getLabelIndexes
 261+ * @see SMWDataValue::getLabelIndex
262262 *
263 - * @return array
 263+ * @return integer
264264 */
265 - public function getLabelIndexes() {
266 - return array( 0, 1 );
 265+ public function getLabelIndex() {
 266+ return 0;
267267 }
268268
269269 }
\ No newline at end of file
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_GeoCoordsValueDescription.php
@@ -47,12 +47,12 @@
4848 * @see SMWDescription::getSQLCondition
4949 *
5050 * @param string $tableName
51 - * @param array $fieldNames
 51+ * @param string $fieldName
5252 * @param DatabaseBase $dbs
5353 *
5454 * @return true
5555 */
56 - public function getSQLCondition( $tableName, array $fieldNames, DatabaseBase $dbs ) {
 56+ public function getSQLCondition( $tableName, $fieldName, DatabaseBase $dbs ) {
5757 $dataValue = $this->getDatavalue();
5858
5959 // Only execute the query when the description's type is geographical coordinates,
@@ -68,8 +68,8 @@
6969
7070 // TODO: Would be safer to have a solid way of determining what's the lat and lon field, instead of assuming it's in this order.
7171 $conditions = array();
72 - $conditions[] = "{$tableName}.{$fieldNames[0]} {$comparator} {$coordinates['lat']}";
73 - $conditions[] = "{$tableName}.{$fieldNames[1]} {$comparator} {$coordinates['lon']}";
 72+ $conditions[] = "{$tableName}.lat {$comparator} {$coordinates['lat']}";
 73+ $conditions[] = "{$tableName}.lon {$comparator} {$coordinates['lon']}";
7474
7575 $whereSQL .= implode( ' && ', $conditions );
7676
Index: trunk/extensions/SemanticMaps/GeoCoords/SM_AreaValueDescription.php
@@ -137,12 +137,12 @@
138138 * @see SMWDescription::getSQLCondition
139139 *
140140 * @param string $tableName
141 - * @param array $fieldNames
 141+ * @param string $fieldName
142142 * @param DatabaseBase $dbs
143143 *
144144 * @return true
145145 */
146 - public function getSQLCondition( $tableName, array $fieldNames, DatabaseBase $dbs ) {
 146+ public function getSQLCondition( $tableName, $fieldName, DatabaseBase $dbs ) {
147147 $dataValue = $this->getDatavalue();
148148
149149 // Only execute the query when the description's type is geographical coordinates,
@@ -160,10 +160,10 @@
161161
162162 // TODO: Would be safer to have a solid way of determining what's the lat and lon field, instead of assuming it's in this order.
163163 $conditions = array();
164 - $conditions[] = "{$tableName}.{$fieldNames[0]} < $north";
165 - $conditions[] = "{$tableName}.{$fieldNames[0]} > $south";
166 - $conditions[] = "{$tableName}.{$fieldNames[1]} < $east";
167 - $conditions[] = "{$tableName}.{$fieldNames[1]} > $west";
 164+ $conditions[] = "{$tableName}.lat < $north";
 165+ $conditions[] = "{$tableName}.lat > $south";
 166+ $conditions[] = "{$tableName}.lon < $east";
 167+ $conditions[] = "{$tableName}.lon > $west";
168168
169169 return implode( ' && ', $conditions );
170170 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66313Changes for 1.5.1...jeroendedauw22:38, 12 May 2010

Status & tagging log