1 | <?php |
||
18 | class Search extends Query |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Constuctor |
||
23 | * @param array $query Default value for this query |
||
24 | */ |
||
25 | 5 | public function __construct(array $query = []) |
|
34 | |||
35 | // -- Builder methods ------------------------------------------------------ |
||
36 | |||
37 | /** |
||
38 | * Query string to search for. |
||
39 | * |
||
40 | * @param string $query The query |
||
41 | * |
||
42 | * @return maxh\Nominatim\Search |
||
43 | */ |
||
44 | 1 | public function query($query) |
|
50 | |||
51 | /** |
||
52 | * Street to search for. |
||
53 | * |
||
54 | * Do not combine with query(). |
||
55 | * |
||
56 | * @param string $street The street |
||
57 | * |
||
58 | * @return maxh\Nominatim\Search |
||
59 | */ |
||
60 | public function street($street) |
||
66 | |||
67 | /** |
||
68 | * City to search for (experimental). |
||
69 | * |
||
70 | * Do not combine with query(). |
||
71 | * |
||
72 | * @param string $city The city |
||
73 | * |
||
74 | * @return maxh\Nominatim\Search |
||
75 | */ |
||
76 | 1 | public function city($city) |
|
82 | |||
83 | /** |
||
84 | * County to search for. |
||
85 | * |
||
86 | * Do not combine with query(). |
||
87 | * |
||
88 | * @param string $county The county |
||
89 | * |
||
90 | * @return maxh\Nominatim\Search |
||
91 | */ |
||
92 | public function county($county) |
||
98 | |||
99 | /** |
||
100 | * State to search for. |
||
101 | * |
||
102 | * Do not combine with query(). |
||
103 | * |
||
104 | * @param string $state The state |
||
105 | * |
||
106 | * @return maxh\Nominatim\Search |
||
107 | */ |
||
108 | public function state($state) |
||
114 | |||
115 | /** |
||
116 | * Country to search for. |
||
117 | * |
||
118 | * Do not combine with query(). |
||
119 | * |
||
120 | * @param string $country The country |
||
121 | * |
||
122 | * @return maxh\Nominatim\Search |
||
123 | */ |
||
124 | 1 | public function country($country) |
|
130 | |||
131 | /** |
||
132 | * Postal code to search for (experimental). |
||
133 | * |
||
134 | * Do not combine with query(). |
||
135 | * |
||
136 | * @param integer $postalCode The postal code |
||
137 | * |
||
138 | * @return maxh\Nominatim\Search |
||
139 | */ |
||
140 | 1 | public function postalCode($postalCode) |
|
146 | |||
147 | /** |
||
148 | * Limit search results to a specific country (or a list of countries). |
||
149 | * |
||
150 | * <countrycode> should be the ISO 3166-1alpha2 code, e.g. gb for the United |
||
151 | * Kingdom, de for Germany, etc. |
||
152 | * |
||
153 | * @param string $countrycode The country code |
||
154 | * |
||
155 | * @return maxh\Nominatim\Search |
||
156 | * @throws maxh\Nominatim\Exceptions\InvalidParameterException if country code is invalid |
||
157 | */ |
||
158 | public function countryCode($countrycode) |
||
172 | |||
173 | /** |
||
174 | * The preferred area to find search results |
||
175 | * |
||
176 | * @param string $left Left of the area |
||
177 | * @param string $top Top of the area |
||
178 | * @param string $right Right of the area |
||
179 | * @param string $bottom Bottom of the area |
||
180 | * |
||
181 | * @return maxh\Nominatim\Search |
||
182 | */ |
||
183 | public function viewBox($left, $top, $right, $bottom) |
||
189 | |||
190 | /** |
||
191 | * If you do not want certain openstreetmap objects to appear in the search results. |
||
192 | * |
||
193 | * @return maxh\Nominatim\Search |
||
194 | * @throws maxh\Nominatim\Exceptions\InvalidParameterException if no place id |
||
195 | */ |
||
196 | public function exludePlaceIds() |
||
208 | |||
209 | /** |
||
210 | * Limit the number of returned results |
||
211 | * |
||
212 | * @param integer $limit |
||
213 | * |
||
214 | * @return maxh\Nominatim\Search |
||
215 | */ |
||
216 | public function limit($limit) |
||
222 | } |
||
223 |