mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
add missing include
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once(CONST_BasePath.'/lib/SpecialSearchOperator.php');
|
|
||||||
|
|
||||||
namespace Nominatim;
|
namespace Nominatim;
|
||||||
|
|
||||||
|
require_once(CONST_BasePath.'/lib/SpecialSearchOperator.php');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description of a single interpretation of a search query.
|
* Description of a single interpretation of a search query.
|
||||||
*/
|
*/
|
||||||
|
|||||||
44
lib/SpecialSearchOperator.php
Normal file
44
lib/SpecialSearchOperator.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Nominatim;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operators describing special searches.
|
||||||
|
*/
|
||||||
|
abstract class Operator
|
||||||
|
{
|
||||||
|
/// No operator selected.
|
||||||
|
const NONE = 0;
|
||||||
|
/// Search for POI of the given type.
|
||||||
|
const TYPE = 1;
|
||||||
|
/// Search for POIs near the given place.
|
||||||
|
const NEAR = 2;
|
||||||
|
/// Search for POIS in the given place.
|
||||||
|
const IN = 3;
|
||||||
|
/// Search for POIS named as given.
|
||||||
|
const NAME = 4;
|
||||||
|
/// Search for postcodes.
|
||||||
|
const POSTCODE = 5;
|
||||||
|
|
||||||
|
private static $aConstantNames = null;
|
||||||
|
|
||||||
|
|
||||||
|
public static function toString($iOperator)
|
||||||
|
{
|
||||||
|
if ($iOperator == Operator::NONE) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Operator::$aConstantNames === null) {
|
||||||
|
$oReflector = new \ReflectionClass('Nominatim\Operator');
|
||||||
|
$aConstants = $oReflector->getConstants();
|
||||||
|
|
||||||
|
Operator::$aConstantNames = array();
|
||||||
|
foreach ($aConstants as $sName => $iValue) {
|
||||||
|
Operator::$aConstantNames[$iValue] = $sName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Operator::$aConstantNames[$iOperator];
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user