forked from hans/Nominatim
move excluded place list to SearchContext
This commit is contained in:
@@ -22,6 +22,7 @@ class SearchContext
|
||||
public $sqlViewboxSmall = '';
|
||||
public $sqlViewboxLarge = '';
|
||||
public $sqlViewboxCentre = '';
|
||||
private $sqlExcludeList = '';
|
||||
|
||||
public function hasNearPoint()
|
||||
{
|
||||
@@ -91,6 +92,11 @@ class SearchContext
|
||||
$this->sqlViewboxLarge = "'".$sGeom."'::geometry";
|
||||
}
|
||||
|
||||
public function setExcludeList($aExcluded)
|
||||
{
|
||||
$this->sqlExcludeList = ' not in ('.join(',', $aExcluded).')';
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract a coordinate point from a query string.
|
||||
*
|
||||
@@ -138,4 +144,13 @@ class SearchContext
|
||||
|
||||
return $sSQL;
|
||||
}
|
||||
|
||||
public function excludeSQL($sVariable)
|
||||
{
|
||||
if ($this->sqlExcludeList) {
|
||||
return $sVariable.$this->sqlExcludeList;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user