1 | <?php |
||
25 | class SearchClient extends AbstractClient |
||
26 | { |
||
27 | /** |
||
28 | * Returns places within a specific area. |
||
29 | * |
||
30 | * @see https://developers.google.com/places/documentation/search |
||
31 | * @see https://developers.google.com/places/documentation/supported_types |
||
32 | * @see https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1 |
||
33 | * |
||
34 | * @param string $location The latitude/longitude around which to retrieve Place information. |
||
35 | * This must be specified as latitude,longitude. |
||
36 | * @param array $params optional parameters |
||
37 | * |
||
38 | * @throws \InvalidArgumentException |
||
39 | * @throws RequestException if the request fails |
||
40 | * |
||
41 | * @return mixed|null |
||
42 | */ |
||
43 | public function nearby($location, $params = []) |
||
66 | |||
67 | /** |
||
68 | * Returns places based on a string. |
||
69 | * |
||
70 | * @see https://developers.google.com/places/documentation/search#TextSearchRequests |
||
71 | * |
||
72 | * @param string $query The text string on which to search, for example: "restaurant". The Place service will return |
||
73 | * candidate matches based on this string and order the results based on their perceived relevance. |
||
74 | * @param array $params optional parameters |
||
75 | * |
||
76 | * @throws RequestException if the request fails |
||
77 | * |
||
78 | * @return mixed|null |
||
79 | */ |
||
80 | public function text($query, $params = []) |
||
86 | |||
87 | /** |
||
88 | * Returns places of a specific area. |
||
89 | * |
||
90 | * @param string $location The latitude/longitude around which to retrieve Place information. This must be specified |
||
91 | * as latitude,longitude. |
||
92 | * @param string $radius Defines the distance (in meters) within which to return Place results. The maximum allowed |
||
93 | * radius is 50 000 meters. |
||
94 | * @param array $params optional parameters |
||
95 | * |
||
96 | * @throws \InvalidArgumentException |
||
97 | * @throws RequestException if the request fails |
||
98 | * |
||
99 | * @return mixed|null |
||
100 | */ |
||
101 | public function radar($location, $radius, $params = []) |
||
113 | |||
114 | /** |
||
115 | * Returns place predictions based on specific text and optional geographic bounds. |
||
116 | * |
||
117 | * @see https://developers.google.com/places/documentation/autocomplete#place_autocomplete_requests |
||
118 | * @see https://developers.google.com/places/documentation/autocomplete#example_autocomplete_requests |
||
119 | * |
||
120 | * @param string $input The text string on which to search. The Place Autocomplete service will return candidate |
||
121 | * matches based on this string and order results based on their perceived relevance. |
||
122 | * @param string $language The language in which to return results. |
||
123 | * @param array $params optional parameters |
||
124 | * |
||
125 | * @throws RequestException if the request fails |
||
126 | * |
||
127 | * @return mixed|null |
||
128 | */ |
||
129 | public function autoComplete($input, $language = 'en', $params = []) |
||
136 | } |
||
137 |