User: Use behavior Bitmask for states and types

This commit is contained in:
Johannes Meyer 2019-11-26 10:01:12 +01:00
parent 2dd5d7ec3a
commit 5d2ed45e19

View file

@ -2,6 +2,7 @@
namespace Icinga\Module\Icingadb\Model;
use Icinga\Module\Icingadb\Model\Behavior\Bitmask;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
@ -53,6 +54,27 @@ class User extends Model
'hostgroup' => 'notification.host.hostgroup',
'servicegroup' => 'notification.service.servicegroup'
]));
$behaviors->add(new Bitmask([
'states' => [
'ok' => 1,
'warning' => 2,
'critical' => 4,
'unknown' => 8,
'up' => 16,
'down' => 32
],
'types' => [
'downtime_start' => 1,
'downtime_end' => 2,
'downtime_removed' => 4,
'custom' => 8,
'ack' => 16,
'problem' => 32,
'recovery' => 64,
'flapping_start' => 128,
'flapping_end' => 256
]
]));
}
public function createRelations(Relations $relations)