mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-27 00:49:55 +03:00
32 lines
669 B
PHP
32 lines
669 B
PHP
|
<?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.')'
|
||
|
);
|
||
|
}
|
||
|
}
|