@@ 17-30 (lines=14) @@ | ||
14 | * |
|
15 | * @return BeaconModel |
|
16 | */ |
|
17 | public function getBeacon($mac) |
|
18 | { |
|
19 | try { |
|
20 | $response = $this->client->get('beacons/'.$mac); |
|
21 | ||
22 | return $this->serializer->deserialize( |
|
23 | $response->getBody(), |
|
24 | BeaconModel::class, |
|
25 | 'json' |
|
26 | ); |
|
27 | } catch (ClientException $e) { |
|
28 | throw $this->createApiException($e); |
|
29 | } |
|
30 | } |
|
31 | ||
32 | /** |
|
33 | * Get the list of beacons. |
|
@@ 37-50 (lines=14) @@ | ||
34 | * |
|
35 | * @return BeaconModel[] |
|
36 | */ |
|
37 | public function getBeacons() |
|
38 | { |
|
39 | try { |
|
40 | $response = $this->client->get('beacons'); |
|
41 | ||
42 | return $this->serializer->deserialize( |
|
43 | $response->getBody(), |
|
44 | 'array<Speicher210\Estimote\Model\Beacon>', |
|
45 | 'json' |
|
46 | ); |
|
47 | } catch (ClientException $e) { |
|
48 | throw $this->createApiException($e); |
|
49 | } |
|
50 | } |
|
51 | ||
52 | /** |
|
53 | * Update one beacon. |