introduce classes for token list and token types

This commit is contained in:
Sarah Hoffmann
2018-05-14 23:04:15 +02:00
parent 2cc4c73b64
commit f29c7bf910
11 changed files with 436 additions and 154 deletions

31
lib/TokenPostcode.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
namespace Nominatim\Token;
/**
* A postcode token.
*/
class Postcode
{
public $iId;
// full postcode
public $sPostcode;
// optional restriction to a given country
public $sCountryCode;
public function __construct($iId, $sPostcode, $sCountryCode = '')
{
$this->iId = $iId;
$this->sPostcode = $sPostcode;
$this->sCountryCode = empty($sCountryCode) ? '' : $sCountryCode;
}
public function debugInfo()
{
return array(
'ID' => $this->iId,
'Type' => 'postcode',
'Info' => $this->sPostcode.'('.$this->sCountryCode.')'
);
}
}