IcingaArguments: avoid false-positives when...

...detecting modification
This commit is contained in:
Thomas Gelf 2016-04-02 20:21:06 +02:00
parent 41ed29df8c
commit 5854e56419
1 changed files with 6 additions and 2 deletions

View File

@ -100,20 +100,24 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
protected function mungeCommandArgument($key, $value)
{
$attrs = array(
'argument_name' => $key,
'argument_name' => (string) $key,
);
$map = array(
'skip_key' => 'skip_key',
'repeat_key' => 'repeat_key',
'required' => 'required',
'order' => 'sort_order',
// 'order' => 'sort_order',
'description' => 'description',
'set_if' => 'set_if',
);
$argValue = null;
if (is_object($value)) {
if (property_exists($value, 'order')) {
$attrs['sort_order'] = (string) $value->order;
}
foreach ($map as $apiKey => $dbKey) {
if (property_exists($value, $apiKey)) {
$attrs[$dbKey] = $value->$apiKey;