Cachet/app/models/Incident.php

39 lines
724 B
PHP
Raw Normal View History

<?php
class Incident extends Eloquent {
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 13:26:53 +00:00
public function getColorAttribute() {
switch ($this->status) {
case 1:
2014-11-19 13:26:53 +00:00
return 'warning';
case 2:
2014-11-19 16:26:42 +00:00
return 'alert';
case 3:
2014-11-19 13:26:53 +00:00
return 'info';
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';
}
}
}