3 * SPDX-License-Identifier: GPL-2.0-only
5 * This file is part of Nominatim. (https://nominatim.org)
7 * Copyright (C) 2022 by the Nominatim developer community.
8 * For a full list of authors see the git log.
14 * Operators describing special searches.
16 abstract class Operator
18 /// No operator selected.
20 /// Search for POI of the given type.
22 /// Search for POIs near the given place.
24 /// Search for POIS in the given place.
26 /// Search for POIS named as given.
28 /// Search for postcodes.
31 private static $aConstantNames = null;
34 public static function toString($iOperator)
36 if ($iOperator == Operator::NONE) {
40 if (Operator::$aConstantNames === null) {
41 $oReflector = new \ReflectionClass('Nominatim\Operator');
42 $aConstants = $oReflector->getConstants();
44 Operator::$aConstantNames = array();
45 foreach ($aConstants as $sName => $iValue) {
46 Operator::$aConstantNames[$iValue] = $sName;
50 return Operator::$aConstantNames[$iOperator];