Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | class MessagingInfo extends Model |
||
14 | { |
||
15 | protected $guarded = []; |
||
16 | protected $appends = [ |
||
17 | 'startTime', |
||
18 | 'endTime' |
||
19 | ]; |
||
20 | |||
21 | 1 | public function getStartTimeAttribute() |
|
22 | { |
||
23 | 1 | return new Carbon($this->attributes['startTime']); |
|
24 | } |
||
25 | |||
26 | 1 | public function getEndTimeAttribute() |
|
27 | { |
||
28 | 1 | return new Carbon($this->attributes['endTime']); |
|
29 | } |
||
30 | |||
31 | 1 | public function getMinutesAttribute() |
|
32 | { |
||
33 | 1 | return round(($this->attributes['duration'] / 1000) / 60, 2); |
|
34 | } |
||
35 | |||
36 | 1 | public function getSecondsAttribute() |
|
37 | { |
||
38 | 1 | return $this->attributes['duration'] / 1000; |
|
39 | } |
||
40 | |||
41 | 1 | public function getHoursAttribute() |
|
44 | } |
||
45 | } |
||
46 |