IcingaObject: return booleans in plain objects

This commit is contained in:
Thomas Gelf 2016-03-16 21:34:46 +01:00
parent 8ecd799d81
commit 03a5708a00
1 changed files with 12 additions and 1 deletions

View File

@ -1472,7 +1472,18 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
// TODO: Do not ship null properties based on flag?
if (!$skipDefaults || $this->differsFromDefaultValue($k, $v)) {
$props[$k] = $v;
if ($k === 'disabled' || $this->propertyIsBoolean($k)) {
if ($v === 'y') {
$props[$k] = true;
} elseif ($v === 'n') {
$props[$k] = false;
} else {
$props[$k] = $v;
}
} else {
$props[$k] = $v;
}
}
}