3 namespace Nominatim\Token;
10 /// Database word id, if available.
12 /// Two-letter country code (lower-cased).
13 private $sCountryCode;
15 public function __construct($iId, $sCountryCode)
18 $this->sCountryCode = $sCountryCode;
21 public function getId()
27 * Derive new searches by adding this token to an existing search.
29 * @param object $oSearch Partial search description derived so far.
30 * @param object $oPosition Description of the token position within
33 * @return SearchDescription[] List of derived search descriptions.
35 public function extendSearch($oSearch, $oPosition)
37 if ($oSearch->hasCountry() || !$oPosition->maybePhrase('country')) {
41 $oNewSearch = $oSearch->clone($oPosition->isLastToken() ? 1 : 6);
42 $oNewSearch->setCountry($this->sCountryCode);
44 return array($oNewSearch);
47 public function debugInfo()
52 'Info' => $this->sCountryCode
56 public function debugCode()