| @@ 60-71 (lines=12) @@ | ||
| 57 | * @param $track The track object |
|
| 58 | * @return string |
|
| 59 | */ |
|
| 60 | public function getTrackStatus($track) |
|
| 61 | { |
|
| 62 | $sequentialStatus = ['failed_at', 'succeed_at', 'process_at', 'queue_at']; |
|
| 63 | ||
| 64 | foreach ($sequentialStatus as $status) { |
|
| 65 | if (!is_null($track->{$status})) { |
|
| 66 | return substr($status, 0, -3); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| 70 | throw new Exception("Can't find the right column to track the Qwatcher", 1); |
|
| 71 | } |
|
| 72 | ||
| 73 | /** |
|
| 74 | * Get current Status prias text, tracking by sequential of status datetime |
|
| @@ 79-90 (lines=12) @@ | ||
| 76 | * @param $track The track object |
|
| 77 | * @return string |
|
| 78 | */ |
|
| 79 | public function getTrackStatusTime($track) |
|
| 80 | { |
|
| 81 | $sequentialStatus = ['failed_at', 'succeed_at', 'process_at', 'queue_at']; |
|
| 82 | ||
| 83 | foreach ($sequentialStatus as $status) { |
|
| 84 | if (!is_null($track->{$status})) { |
|
| 85 | return $track->{$status}; |
|
| 86 | } |
|
| 87 | } |
|
| 88 | ||
| 89 | throw new Exception("Can't find the right column to track the Qwatcher", 1); |
|
| 90 | } |
|
| 91 | } |
|
| 92 | ||