r89439 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89438‎ | r89439 | r89440 >
Date:20:25, 3 June 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r89438
Modified paths:
  • /trunk/extensions/SemanticMaps/includes/SM_AreaValueDescription.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/SM_AreaValueDescription.php
@@ -28,32 +28,32 @@
2929 /**
3030 * Constructor.
3131 *
32 - * @since 0.8
 32+ * @since 0.6
3333 *
3434 * @param SMWDataItem $dataItem
3535 * @param string $comparator
3636 * @param string $radius
3737 */
3838 public function __construct( SMWDataItem $dataItem, $comparator, $radius ) {
39 - parent::__construct( $dataValue, $comparator );
 39+ parent::__construct( $dataItem, $comparator );
4040
4141 // Only if the MapsGeoFunctions class is loaded, we can create the bounding box.
4242 if ( self::geoFunctionsAreAvailable() ) {
43 - $this->calculateBounds( $dataValue, $radius );
 43+ $this->calculateBounds( $dataItem, $radius );
4444 }
4545 }
4646
4747 /**
48 - * Sets the mBounds fields to an array returned by SMAreaValueDescription::getBoundingBox.
 48+ * Sets the bounds fields to an array returned by SMAreaValueDescription::getBoundingBox.
4949 *
5050 * @since 0.6
5151 *
52 - * @param SMGeoCoordsValue $dataValue
 52+ * @param SMWDIGeoCoord $dataItem
5353 * @param string $radius
5454 */
55 - protected function calculateBounds( SMGeoCoordsValue $dataValue, $radius ) {
 55+ protected function calculateBounds( SMWDIGeoCoord $dataItem, $radius ) {
5656 $this->bounds = self::getBoundingBox(
57 - $dataValue->getCoordinateSet(),
 57+ array( 'lat' => $dataItem->getLatitude(), 'lon' => $dataItem->getLongitude() ),
5858 MapsDistanceParser::parseDistance( $radius )
5959 );
6060 }
@@ -66,8 +66,8 @@
6767 * @param Boolean $asvalue
6868 */
6969 public function getQueryString( $asValue = false ) {
70 - if ( $this->m_datavalue !== null ) {
71 - $queryString = $this->m_datavalue->getWikiValue();
 70+ if ( $this->getDataItem() !== null ) {
 71+ $queryString = SMWDataValueFactory::newDataItemValue( $this->getDataItem() )->getWikiValue();
7272 return $asValue ? $queryString : "[[$queryString]]";
7373 } else {
7474 return $asValue ? '+' : '';
@@ -117,12 +117,9 @@
118118 * @return string or false
119119 */
120120 public function getSQLCondition( $tableName, array $fieldNames, $dbs ) {
121 - $dataValue = $this->getDatavalue();
122 -
123121 // Only execute the query when the description's type is geographical coordinates,
124122 // the description is valid, and the near comparator is used.
125 - if ( $dataValue->getTypeID() != '_geo'
126 - || !$dataValue->isValid()
 123+ if ( $this->getDataItem()->getDIType() != SMWDataItem::TYPE_GEO
127124 || ( $this->getComparator() != SMW_CMP_EQ && $this->getComparator() != SMW_CMP_NEQ )
128125 ) {
129126 return false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89438fixes related to DV/DI changes in SMW 1.6jeroendedauw20:12, 3 June 2011

Status & tagging log