]> git.openstreetmap.org Git - nominatim.git/commitdiff
make all Token menbers private
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 18 Jul 2021 18:20:22 +0000 (20:20 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 18 Jul 2021 20:54:55 +0000 (22:54 +0200)
lib-php/Geocode.php
lib-php/TokenSpecialTerm.php

index 82892eae6e78bd176bd4724be34de111374474a7..52b92c9928770f3baac9d4b162d90f9d1c904748 100644 (file)
@@ -555,15 +555,15 @@ class Geocode
 
                 if (!empty($aTokens)) {
                     $aNewSearches = array();
+                    $oPosition = new SearchPosition('', 0, 1);
+                    $oPosition->setTokenPosition(0, 1);
+
                     foreach ($aSearches as $oSearch) {
                         foreach ($aTokens as $oToken) {
-                            $oNewSearch = clone $oSearch;
-                            $oNewSearch->setPoiSearch(
-                                $oToken->iOperator,
-                                $oToken->sClass,
-                                $oToken->sType
+                            $aNewSearches = array_merge(
+                                $aNewSearches,
+                                $oToken->extendSearch($oSearch, $oPosition)
                             );
-                            $aNewSearches[] = $oNewSearch;
                         }
                     }
                     $aSearches = $aNewSearches;
index 355dbb91aa32b6ad73af02a142e763559fe89583..5b2d4c70a64f75de8971da78500bc2b8ad65e331 100644 (file)
@@ -10,13 +10,13 @@ require_once(CONST_LibDir.'/SpecialSearchOperator.php');
 class SpecialTerm
 {
     /// Database word id, if applicable.
-    public $iId;
+    private $iId;
     /// Class (or OSM tag key) of the place to look for.
-    public $sClass;
+    private $sClass;
     /// Type (or OSM tag value) of the place to look for.
-    public $sType;
+    private $sType;
     /// Relationship of the operator to the object (see Operator class).
-    public $iOperator;
+    private $iOperator;
 
     public function __construct($iID, $sClass, $sType, $iOperator)
     {