]> git.openstreetmap.org Git - nominatim.git/blob - lib/TokenSpecialTerm.php
introduce classes for token list and token types
[nominatim.git] / lib / TokenSpecialTerm.php
1 <?php
2
3 namespace Nominatim\Token;
4
5 require_once(CONST_BasePath.'/lib/SpecialSearchOperator.php');
6
7 /**
8  * A word token describing a place type.
9  */
10 class SpecialTerm
11 {
12     public $iId;
13     public $sClass;
14     public $sType;
15     public $iOperator;
16
17     public function __construct($iID, $sClass, $sType, $iOperator)
18     {
19         $this->iId = $iID;
20         $this->sClass = $sClass;
21         $this->sType = $sType;
22         $this->iOperator = $iOperator;
23     }
24
25     public function debugInfo()
26     {
27         return array(
28                 'ID' => $this->iId,
29                 'Type' => 'special term',
30                 'Info' => array(
31                            'class' => $this->sClass,
32                            'type' => $this->sType,
33                            'operator' => Operator::toString($this->iOperator)
34                           )
35                );
36     }
37 }