1 | <?php |
||
10 | class Client implements HttpContract |
||
11 | { |
||
12 | use ConfigurationTrait, |
||
13 | HttpTrait; |
||
14 | |||
15 | /** |
||
16 | * Access token |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $accessToken; |
||
21 | |||
22 | /** |
||
23 | * Creates new client |
||
24 | * |
||
25 | * @param array $options |
||
26 | */ |
||
27 | public function __construct(array $options = array()) |
||
40 | |||
41 | /** |
||
42 | * Creates default client with appropriate authorization header. |
||
43 | * |
||
44 | * @return GuzzleHttp\Client |
||
45 | */ |
||
46 | public function createDefaultClient() |
||
54 | |||
55 | /** |
||
56 | * Fetches results from the Autocomplete API. |
||
57 | * |
||
58 | * @param array $parameters |
||
59 | * |
||
60 | * @return stdClass |
||
61 | * @throws Stevenmaguire\Yelp\Exception\HttpException |
||
62 | * @link https://www.yelp.com/developers/documentation/v3/autocomplete |
||
63 | */ |
||
64 | public function getAutocompleteResults($parameters = []) |
||
71 | |||
72 | /** |
||
73 | * Fetches a specific business by id. |
||
74 | * |
||
75 | * @param string $businessId |
||
76 | * @param array $parameters |
||
77 | * |
||
78 | * @return stdClass |
||
79 | * @throws Stevenmaguire\Yelp\Exception\HttpException |
||
80 | * @link https://www.yelp.com/developers/documentation/v3/business |
||
81 | */ |
||
82 | public function getBusiness($businessId, $parameters = []) |
||
89 | |||
90 | /** |
||
91 | * Fetches reviews for a specific business by id. |
||
92 | * |
||
93 | * @param string $businessId |
||
94 | * @param array $parameters |
||
95 | * |
||
96 | * @return stdClass |
||
97 | * @throws Stevenmaguire\Yelp\Exception\HttpException |
||
98 | * @link https://www.yelp.com/developers/documentation/v3/business_reviews |
||
99 | */ |
||
100 | public function getBusinessReviews($businessId, $parameters = []) |
||
107 | |||
108 | /** |
||
109 | * Fetches results from the Business Search API. |
||
110 | * |
||
111 | * @param array $parameters |
||
112 | * |
||
113 | * @return stdClass |
||
114 | * @throws Stevenmaguire\Yelp\Exception\HttpException |
||
115 | * @link https://www.yelp.com/developers/documentation/v3/business_search |
||
116 | */ |
||
117 | public function getBusinessesSearchResults($parameters = []) |
||
128 | |||
129 | /** |
||
130 | * Fetches results from the Business Search API by Phone. |
||
131 | * |
||
132 | * @param string $phoneNumber |
||
133 | * |
||
134 | * @return stdClass |
||
135 | * @throws Stevenmaguire\Yelp\Exception\HttpException |
||
136 | * @link https://www.yelp.com/developers/documentation/v3/business_search_phone |
||
137 | */ |
||
138 | public function getBusinessesSearchResultsByPhone($phoneNumber) |
||
149 | |||
150 | /** |
||
151 | * Fetches results from the Business Search API by Type. |
||
152 | * |
||
153 | * @param string $type |
||
154 | * @param array $parameters |
||
155 | * |
||
156 | * @return stdClass |
||
157 | * @throws Stevenmaguire\Yelp\Exception\HttpException |
||
158 | * @link https://www.yelp.com/developers/documentation/v3/transactions_search |
||
159 | */ |
||
160 | public function getTransactionsSearchResultsByType($type, $parameters = []) |
||
167 | } |
||
168 |