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

37
lib/TokenSpecialTerm.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
namespace Nominatim\Token;
require_once(CONST_BasePath.'/lib/SpecialSearchOperator.php');
/**
* A word token describing a place type.
*/
class SpecialTerm
{
public $iId;
public $sClass;
public $sType;
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)
)
);
}
}