-/**
- * 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 $aConstantNames = null;
-
- public static function toString($iOperator)
- {
- if ($iOperator == Operator::NONE) {
- return '';
- }
-
- if ($aConstantNames === null) {
- $oReflector = new \ReflectionClass ('Nominatim\Operator');
- $aConstants = $oReflector->getConstants();
-
- $aConstantNames = array();
- foreach ($aConstants as $sName => $iValue) {
- $aConstantNames[$iValue] = $sName;
- }
- }
-
- return $aConstantNames[$iOperator];
- }
-}