move excluded place list to SearchContext

This commit is contained in:
Sarah Hoffmann
2017-10-08 23:15:06 +02:00
parent 86c0858130
commit 907133a38c
3 changed files with 33 additions and 32 deletions

View File

@@ -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 '';
}
}