1 | <?php |
||
5 | class Device |
||
6 | { |
||
7 | /** |
||
8 | * The fields that we want to retrieve for the device |
||
9 | * |
||
10 | * @var array $fields |
||
11 | */ |
||
12 | |||
13 | protected $fields = [ |
||
14 | 'nickname', |
||
15 | 'iden', |
||
16 | 'model', |
||
17 | 'type', |
||
18 | 'active', |
||
19 | 'pushable', |
||
20 | 'manufacturer', |
||
21 | 'created', |
||
22 | ]; |
||
23 | |||
24 | 12 | public function __construct(array $attr) |
|
30 | |||
31 | /** |
||
32 | * @param array $attr |
||
33 | * @param string $field |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | 12 | protected function getFieldValue(array $attr, $field) |
|
49 | |||
50 | /** |
||
51 | * Format the date so that it's readable |
||
52 | * |
||
53 | * @param integer $date |
||
54 | * @return string |
||
55 | */ |
||
56 | |||
57 | 12 | protected function setCreated($date) |
|
61 | } |
||
62 |