2018-05-15 00:04:15 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Nominatim\Token;
|
|
|
|
|
|
|
|
require_once(CONST_BasePath.'/lib/SpecialSearchOperator.php');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A word token describing a place type.
|
|
|
|
*/
|
|
|
|
class SpecialTerm
|
|
|
|
{
|
2018-05-15 00:23:38 +03:00
|
|
|
/// Database word id, if applicable.
|
2018-05-15 00:04:15 +03:00
|
|
|
public $iId;
|
2018-05-15 00:23:38 +03:00
|
|
|
/// Class (or OSM tag key) of the place to look for.
|
2018-05-15 00:04:15 +03:00
|
|
|
public $sClass;
|
2018-05-15 00:23:38 +03:00
|
|
|
/// Type (or OSM tag value) of the place to look for.
|
2018-05-15 00:04:15 +03:00
|
|
|
public $sType;
|
2018-05-15 00:23:38 +03:00
|
|
|
/// Relationship of the operator to the object (see Operator class).
|
2018-05-15 00:04:15 +03:00
|
|
|
public $iOperator;
|
|
|
|
|
|
|
|
public function __construct($iID, $sClass, $sType, $iOperator)
|
|
|
|
{
|
|
|
|
$this->iId = $iID;
|
|
|
|
$this->sClass = $sClass;
|
|
|
|
$this->sType = $sType;
|
|
|
|
$this->iOperator = $iOperator;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function debugInfo()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'ID' => $this->iId,
|
|
|
|
'Type' => 'special term',
|
|
|
|
'Info' => array(
|
|
|
|
'class' => $this->sClass,
|
|
|
|
'type' => $this->sType,
|
|
|
|
'operator' => Operator::toString($this->iOperator)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|