1 | <?php |
||
9 | class Model |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $data; |
||
16 | |||
17 | /** |
||
18 | * @var Api |
||
19 | */ |
||
20 | protected $api; |
||
21 | |||
22 | /** |
||
23 | * Constructor |
||
24 | * |
||
25 | * @param array $data |
||
26 | * @param Api $api |
||
27 | */ |
||
28 | public function __construct(array $data, Api $api = null) |
||
33 | |||
34 | /** |
||
35 | * Get data |
||
36 | * |
||
37 | * @param string $key |
||
38 | * @return mixed|null |
||
39 | */ |
||
40 | public function get($key) |
||
47 | |||
48 | /** |
||
49 | * @param string $method |
||
50 | * @param array $arguments |
||
51 | * @return mixed |
||
52 | */ |
||
53 | public function __call($method, $arguments) |
||
60 | |||
61 | /** |
||
62 | * Get data as array |
||
63 | * |
||
64 | * @return array |
||
65 | */ |
||
66 | public function all() |
||
70 | |||
71 | /** |
||
72 | * @return Api |
||
73 | */ |
||
74 | public function getApi() |
||
78 | } |
||
79 |