1 | <?php |
||
8 | class DriveNow |
||
9 | { |
||
10 | const CITY_MUNICH = 4604; |
||
11 | const CITY_BERLIN = 6099; |
||
12 | const CITY_DUSSELDORF = 1293; |
||
13 | const CITY_COLOGNE = 1774; |
||
14 | const CITY_HAMBURG = 40065; |
||
15 | const CITY_VIENNA = 40468; |
||
16 | const CITY_LONDON = 40758; |
||
17 | const CITY_COPENHAGEN = 41369; |
||
18 | const CITY_STOCKHOLM = 42128; |
||
19 | const CITY_BRUSSELS = 42619; |
||
20 | const CITY_MILANO = 42756; |
||
21 | |||
22 | private $city_id; |
||
23 | private $api_key; |
||
24 | private $cache; |
||
25 | private $city_cache; |
||
26 | |||
27 | /** |
||
28 | * DriveNow constructor. |
||
29 | * DriveNow constructor. |
||
30 | * @param string $api_key |
||
31 | * @param int|null $city |
||
32 | */ |
||
33 | public function __construct(string $api_key, integer $city = null) |
||
40 | |||
41 | /** |
||
42 | * Refresh city cache |
||
43 | */ |
||
44 | public function refreshCity() |
||
49 | |||
50 | /** |
||
51 | * Handle to get the raw data |
||
52 | * @return mixed |
||
53 | */ |
||
54 | public function getData() |
||
58 | |||
59 | /** |
||
60 | * Get array with cars |
||
61 | * @return array |
||
62 | */ |
||
63 | public function getCars() |
||
71 | |||
72 | /** |
||
73 | * Get the amount of cars in the given city |
||
74 | * @return integer |
||
75 | */ |
||
76 | public function countCars() |
||
80 | |||
81 | /** |
||
82 | * Recieve cities supported by Drive Now |
||
83 | * @return array |
||
84 | */ |
||
85 | public function getCities() |
||
96 | |||
97 | } |