2014-11-16 23:01:12 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Incident extends Eloquent {
|
2014-11-16 23:34:46 +00:00
|
|
|
public function getHumanStatusAttribute() {
|
|
|
|
switch ($this->status) {
|
|
|
|
case 1: return 'Investigating';
|
|
|
|
case 2: return 'Identified';
|
|
|
|
case 3: return 'Watching';
|
|
|
|
case 4: return 'Fixed';
|
|
|
|
}
|
|
|
|
}
|
2014-11-19 12:02:51 +00:00
|
|
|
|
2014-11-19 13:26:53 +00:00
|
|
|
public function getColorAttribute() {
|
2014-11-19 12:02:51 +00:00
|
|
|
switch ($this->status) {
|
|
|
|
case 1:
|
2014-11-19 13:26:53 +00:00
|
|
|
return 'warning';
|
2014-11-19 12:02:51 +00:00
|
|
|
case 2:
|
2014-11-19 16:26:42 +00:00
|
|
|
return 'alert';
|
2014-11-19 12:02:51 +00:00
|
|
|
case 3:
|
2014-11-19 13:26:53 +00:00
|
|
|
return 'info';
|
2014-11-19 12:02:51 +00:00
|
|
|
case 4:
|
2014-11-19 13:26:53 +00:00
|
|
|
return 'success';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIconAttribute() {
|
|
|
|
switch ($this->status) {
|
|
|
|
case 1:
|
|
|
|
return 'glyphicon-flag';
|
|
|
|
case 2:
|
2014-11-19 16:26:42 +00:00
|
|
|
return 'glyphicon-warning-sign';
|
2014-11-19 13:26:53 +00:00
|
|
|
case 3:
|
|
|
|
return 'glyphicon-eye-open';
|
|
|
|
case 4:
|
|
|
|
return 'glyphicon-ok';
|
2014-11-19 12:02:51 +00:00
|
|
|
}
|
|
|
|
}
|
2014-11-16 23:01:12 +00:00
|
|
|
}
|