1 | <?php |
||
14 | class Query implements QueryInterface |
||
15 | { |
||
16 | /** |
||
17 | * Contain the path of the request |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $path; |
||
21 | |||
22 | /** |
||
23 | * Contain the query for request |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $query = []; |
||
27 | |||
28 | /** |
||
29 | * Contain the format for decode data returning by the request |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $format; |
||
33 | |||
34 | /** |
||
35 | * Output polygon format accepted |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $polygon = ['geojson', 'kml', 'svg', 'text']; |
||
39 | |||
40 | |||
41 | /** |
||
42 | * Constuctor |
||
43 | * @param array $query Default value for this query |
||
44 | */ |
||
45 | public function __construct(array $query = []) |
||
57 | |||
58 | // -- Builder methods ------------------------------------------------------ |
||
59 | |||
60 | /** |
||
61 | * Format returning by the request. |
||
62 | * |
||
63 | * @param string $format The output format for the request |
||
64 | * |
||
65 | * @return maxh\Nominatim\Query |
||
66 | * @throws maxh\Nominatim\Exceptions\InvalidParameterException if format is not supported |
||
67 | */ |
||
68 | public function format($format) |
||
82 | |||
83 | /** |
||
84 | * Preferred language order for showing search results, overrides the value |
||
85 | * specified in the "Accept-Language" HTTP header. Either uses standard |
||
86 | * rfc2616 accept-language string or a simple comma separated list of |
||
87 | * language codes. |
||
88 | * |
||
89 | * @param string $language Preferred language order for showing search results, overrides the value specified in the "Accept-Language" HTTP header. |
||
90 | * Either uses standard rfc2616 accept-language string or a simple comma separated list of language codes. |
||
91 | * |
||
92 | * @return maxh\Nominatim\Query |
||
93 | */ |
||
94 | public function language($language) |
||
100 | |||
101 | /** |
||
102 | * Include a breakdown of the address into elements. |
||
103 | * |
||
104 | * @param boolean $details |
||
105 | * |
||
106 | * @return maxh\Nominatim\Query |
||
107 | */ |
||
108 | public function addressDetails($details = true) |
||
114 | |||
115 | /** |
||
116 | * Include additional information in the result if available |
||
117 | * |
||
118 | * @param boolean $tags |
||
119 | * |
||
120 | * @return maxh\Nominatim\Query |
||
121 | */ |
||
122 | public function extraTags($tags = true) |
||
128 | |||
129 | /** |
||
130 | * Include a list of alternative names in the results. |
||
131 | * These may include language variants, references, operator and brand. |
||
132 | * |
||
133 | * @param boolean $details |
||
134 | * |
||
135 | * @return maxh\Nominatim\Query |
||
136 | */ |
||
137 | public function nameDetails($details = true) |
||
143 | |||
144 | /** |
||
145 | * If you are making large numbers of request please include a valid email address or alternatively include your email address as part of the User-Agent string. |
||
146 | * This information will be kept confidential and only used to contact you in the event of a problem, see Usage Policy for more details. |
||
147 | * |
||
148 | * @param string $email Address mail |
||
149 | * |
||
150 | * @return maxh\Nominatim\Query |
||
151 | */ |
||
152 | public function email($email) |
||
158 | |||
159 | /** |
||
160 | * Returns the URL-encoded query. |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | public function getQueryString() |
||
168 | |||
169 | // -- Getters & Setters ---------------------------------------------------- |
||
170 | |||
171 | /** |
||
172 | * Get path |
||
173 | * @return string |
||
174 | */ |
||
175 | public function getPath() |
||
179 | |||
180 | /** |
||
181 | * Get query |
||
182 | * @return array |
||
183 | */ |
||
184 | public function getQuery() |
||
188 | |||
189 | /** |
||
190 | * Get format |
||
191 | * @return string |
||
192 | */ |
||
193 | public function getFormat() |
||
197 | |||
198 | /** |
||
199 | * Set path |
||
200 | * @param string $path Name's path of the service |
||
201 | */ |
||
202 | protected function setPath($path) |
||
206 | |||
207 | /** |
||
208 | * Set query |
||
209 | * @param array $query Parameter of the query |
||
210 | */ |
||
211 | protected function setQuery($query = array()) |
||
215 | |||
216 | /** |
||
217 | * Set format |
||
218 | * @param string $format Format returning by the response |
||
219 | */ |
||
220 | protected function setFormat($format) |
||
224 | |||
225 | } |
||
226 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.