1 | <?php namespace Arcanedev\LaravelTracker\Models; |
||
17 | class Device extends AbstractModel |
||
18 | { |
||
19 | /* ------------------------------------------------------------------------------------------------ |
||
20 | | Constants |
||
21 | | ------------------------------------------------------------------------------------------------ |
||
22 | */ |
||
23 | const KIND_COMPUTER = 'computer'; |
||
24 | const KIND_PHONE = 'phone'; |
||
25 | const KIND_TABLET = 'tablet'; |
||
26 | const KIND_UNAVAILABLE = 'unavailable'; |
||
27 | |||
28 | /* ------------------------------------------------------------------------------------------------ |
||
29 | | Properties |
||
30 | | ------------------------------------------------------------------------------------------------ |
||
31 | */ |
||
32 | /** |
||
33 | * The table associated with the model. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $table = 'devices'; |
||
38 | |||
39 | /** |
||
40 | * The attributes that are mass assignable. |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $fillable = [ |
||
45 | 'kind', |
||
46 | 'model', |
||
47 | 'platform', |
||
48 | 'platform_version', |
||
49 | ]; |
||
50 | |||
51 | /** |
||
52 | * The attributes that should be cast to native types. |
||
53 | * |
||
54 | * @var array |
||
55 | */ |
||
56 | protected $casts = [ |
||
57 | 'id' => 'integer', |
||
58 | ]; |
||
59 | |||
60 | /* ------------------------------------------------------------------------------------------------ |
||
61 | | Relationships |
||
62 | | ------------------------------------------------------------------------------------------------ |
||
63 | */ |
||
64 | |||
65 | /* ------------------------------------------------------------------------------------------------ |
||
66 | | Check Functions |
||
67 | | ------------------------------------------------------------------------------------------------ |
||
68 | */ |
||
69 | /** |
||
70 | * Is this a computer? |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function isComputer() |
||
78 | |||
79 | /** |
||
80 | * Is this a phone? |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function isPhone() |
||
88 | |||
89 | /** |
||
90 | * Is this a tablet? |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function isTablet() |
||
98 | } |
||
99 |