Total Complexity | 8 |
Total Lines | 95 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class Agent extends Model |
||
20 | { |
||
21 | /** |
||
22 | * guarded |
||
23 | * |
||
24 | * (default value: []) |
||
25 | * |
||
26 | * @var mixed |
||
27 | * @access protected |
||
28 | */ |
||
29 | protected $guarded = []; |
||
30 | |||
31 | /** |
||
32 | * userTypes |
||
33 | * |
||
34 | * @var mixed |
||
35 | * @access protected |
||
36 | */ |
||
37 | protected $userTypes = [ |
||
38 | 0 => 'System', |
||
39 | 1 => 'Human', |
||
40 | 2 => 'Bot' |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * getUserTypeNameAttribute function. |
||
45 | * |
||
46 | * @access public |
||
47 | * @return string |
||
48 | * @codeCoverageIgnore |
||
49 | */ |
||
50 | public function getUserTypeNameAttribute() |
||
51 | { |
||
52 | $typeid = isset($this->attributes['userTypeId']) ? $this->attributes['userTypeId'] : $this->attributes['userType']; |
||
53 | return $this->userTypes[$typeid]; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * getLastUpdatedTimeAttribute function. |
||
58 | * |
||
59 | * @access public |
||
60 | * @return \Carbon\Carbon |
||
61 | * @codeCoverageIgnore |
||
62 | */ |
||
63 | public function getLastUpdatedTimeAttribute() |
||
64 | { |
||
65 | return new Carbon($this->attributes['lastUpdatedTime']); |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * getCurrentStatusStartTimeAttribute function. |
||
70 | * |
||
71 | * @access public |
||
72 | * @return \Carbon\Carbon |
||
73 | * @codeCoverageIgnore |
||
74 | */ |
||
75 | public function getCurrentStatusStartTimeAttribute() |
||
76 | { |
||
77 | return new Carbon($this->attributes['currentStatusStartTime']); |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * getCurrentStatusReasonStartTimeAttribute function. |
||
82 | * |
||
83 | * @access public |
||
84 | * @return \Carbon\Carbon |
||
85 | * @codeCoverageIgnore |
||
86 | */ |
||
87 | public function getCurrentStatusReasonStartTimeAttribute() |
||
88 | { |
||
89 | return new Carbon($this->attributes['currentStatusReasonStartTime']); |
||
90 | } |
||
91 | |||
92 | /** |
||
93 | * getStatusMinutesAttribute function. |
||
94 | * |
||
95 | * @access public |
||
96 | * @return float |
||
97 | * @codeCoverageIgnore |
||
98 | */ |
||
99 | public function getStatusMinutesAttribute() |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * getAvatarAttribute function. |
||
106 | * |
||
107 | * @access public |
||
108 | * @return string |
||
109 | * @codeCoverageIgnore |
||
110 | */ |
||
111 | public function getAvatarAttribute() |
||
114 | } |
||
115 | |||
116 | } |