1 | <?php |
||
26 | class LatLongHandler extends DataValueHandler { |
||
27 | |||
28 | /** |
||
29 | * Default to the Earth/Moon longitude range |
||
30 | */ |
||
31 | const MINIMUM_LONGITUDE = -180; |
||
32 | |||
33 | /** |
||
34 | * Default to approximately a second (1/3600) for range searches. This is an arbitrary |
||
35 | * decision because coordinates like 12°34'56" with a precision of a second are very common. |
||
36 | */ |
||
37 | const EPSILON = 0.00028; |
||
38 | |||
39 | /** |
||
40 | * @var GlobeMath |
||
41 | */ |
||
42 | private $math; |
||
43 | |||
44 | public function __construct() { |
||
47 | |||
48 | /** |
||
49 | * @see DataValueHandler::getBaseTableName |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | protected function getBaseTableName() { |
||
56 | |||
57 | /** |
||
58 | * @see DataValueHandler::completeTable |
||
59 | * |
||
60 | * @param Table $table |
||
61 | */ |
||
62 | protected function completeTable( Table $table ) { |
||
70 | |||
71 | /** |
||
72 | * @see DataValueHandler::getSortFieldNames |
||
73 | * |
||
74 | * @return string[] |
||
75 | */ |
||
76 | public function getSortFieldNames() { |
||
80 | |||
81 | /** |
||
82 | * @see DataValueHandler::getInsertValues |
||
83 | * |
||
84 | * @param DataValue $value |
||
85 | * |
||
86 | * @return array |
||
87 | * @throws InvalidArgumentException |
||
88 | */ |
||
89 | public function getInsertValues( DataValue $value ) { |
||
106 | |||
107 | /** |
||
108 | * @see DataValueHandler::addMatchConditions |
||
109 | * |
||
110 | * @param QueryBuilder $builder |
||
111 | * @param ValueDescription $description |
||
112 | * |
||
113 | * @throws InvalidArgumentException |
||
114 | * @throws QueryNotSupportedException |
||
115 | */ |
||
116 | public function addMatchConditions( QueryBuilder $builder, ValueDescription $description ) { |
||
132 | |||
133 | /** |
||
134 | * @param QueryBuilder $builder |
||
135 | * @param LatLongValue $value |
||
136 | * @param float|int $epsilon |
||
137 | */ |
||
138 | private function addInRangeConditions( QueryBuilder $builder, LatLongValue $value, $epsilon ) { |
||
152 | |||
153 | } |
||
154 |