]> git.openstreetmap.org Git - nominatim.git/commitdiff
use object properties in loadStructuredAddressElement()
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 17 Sep 2013 16:33:44 +0000 (18:33 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 17 Sep 2013 16:33:44 +0000 (18:33 +0200)
lib/Geocode.php

index cadad11122d2c831c1fad9ca0fc4651c59ce2399..16c40f529fe347592027508201712af564f3ec92 100644 (file)
                        return $this->sQuery;
                }
 
-               function loadStructuredAddressElement(&$aStructuredQuery, &$iMinAddressRank, &$iMaxAddressRank, &$aAddressRankList, $sValue, $sKey, $iNewMinAddressRank, $iNewMaxAddressRank, $aItemListValues)
+               function loadStructuredAddressElement($sValue, $sKey, $iNewMinAddressRank, $iNewMaxAddressRank, $aItemListValues)
                {
                        $sValue = trim($sValue);
                        if (!$sValue) return false;
-                       $aStructuredQuery[$sKey] = $sValue;
-                       if ($iMinAddressRank == 0 && $iMaxAddressRank == 30)
+                       $this->aStructuredQuery[$sKey] = $sValue;
+                       if ($this->iMinAddressRank == 0 && $this->iMaxAddressRank == 30)
                        {
-                               $iMinAddressRank = $iNewMinAddressRank;
-                               $iMaxAddressRank = $iNewMaxAddressRank;
+                               $this->iMinAddressRank = $iNewMinAddressRank;
+                               $this->iMaxAddressRank = $iNewMaxAddressRank;
                        }
-                       if ($aItemListValues) $aAddressRankList = array_merge($aAddressRankList, $aItemListValues);
+                       if ($aItemListValues) $this->aAddressRankList = array_merge($this->aAddressRankList, $aItemListValues);
                        return true;
                }
 
                        $this->aStructuredQuery = array();
                        $this->sAllowedTypesSQLList = '';
 
-                       $this->loadStructuredAddressElement($this->aStructuredQuery, $this->iMinAddressRank, $this->iMaxAddressRank, $this->aAddressRankList, $sAmentiy, 'amenity', 26, 30, false);
-                       $this->loadStructuredAddressElement($this->aStructuredQuery, $this->iMinAddressRank, $this->iMaxAddressRank, $this->aAddressRankList, $sStreet, 'street', 26, 30, false);
-                       $this->loadStructuredAddressElement($this->aStructuredQuery, $this->iMinAddressRank, $this->iMaxAddressRank, $this->aAddressRankList, $sCity, 'city', 14, 24, false);
-                       $this->loadStructuredAddressElement($this->aStructuredQuery, $this->iMinAddressRank, $this->iMaxAddressRank, $this->aAddressRankList, $sCounty, 'county', 9, 13, false);
-                       $this->loadStructuredAddressElement($this->aStructuredQuery, $this->iMinAddressRank, $this->iMaxAddressRank, $this->aAddressRankList, $sState, 'state', 8, 8, false);
-                       $this->loadStructuredAddressElement($this->aStructuredQuery, $this->iMinAddressRank, $this->iMaxAddressRank, $this->aAddressRankList, $sPostalCode, 'postalcode' , 5, 11, array(5, 11));
-                       $this->loadStructuredAddressElement($this->aStructuredQuery, $this->iMinAddressRank, $this->iMaxAddressRank, $this->aAddressRankList, $sCountry, 'country', 4, 4, false);
+                       $this->loadStructuredAddressElement($sAmentiy, 'amenity', 26, 30, false);
+                       $this->loadStructuredAddressElement($sStreet, 'street', 26, 30, false);
+                       $this->loadStructuredAddressElement($sCity, 'city', 14, 24, false);
+                       $this->loadStructuredAddressElement($sCounty, 'county', 9, 13, false);
+                       $this->loadStructuredAddressElement($sState, 'state', 8, 8, false);
+                       $this->loadStructuredAddressElement($sPostalCode, 'postalcode' , 5, 11, array(5, 11));
+                       $this->loadStructuredAddressElement($sCountry, 'country', 4, 4, false);
 
                        if (sizeof($this->aStructuredQuery) > 0) 
                        {