IcingaObject: introduce differsFromDefaultValue

This commit is contained in:
Thomas Gelf 2016-02-23 00:26:39 +01:00
parent 2ba404c2c7
commit 23090c502a
1 changed files with 9 additions and 0 deletions

View File

@ -1129,6 +1129,15 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return (object) $props;
}
protected function differsFromDefaultValue($key, $value)
{
if (array_key_exists($key, $this->defaultProperties)) {
return $value !== $this->defaultProperties[$key];
} else {
return $value !== null;
}
}
public function toJson(
$resolved = false,
$skipNull = false,