mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-26 23:34:10 +02:00
IcingaCommandArgument: add more data type support
This commit is contained in:
parent
8be79b3dd6
commit
7ca64e18a7
@ -10,6 +10,11 @@ class IcingaCommandArgument extends IcingaObject
|
|||||||
|
|
||||||
protected $table = 'icinga_command_argument';
|
protected $table = 'icinga_command_argument';
|
||||||
|
|
||||||
|
protected $booleans = array(
|
||||||
|
'skip_key' => 'skip_key',
|
||||||
|
'repeat_key' => 'repeat_key'
|
||||||
|
);
|
||||||
|
|
||||||
protected $defaultProperties = array(
|
protected $defaultProperties = array(
|
||||||
'id' => null,
|
'id' => null,
|
||||||
'command_id' => null,
|
'command_id' => null,
|
||||||
@ -48,6 +53,18 @@ class IcingaCommandArgument extends IcingaObject
|
|||||||
case 'string':
|
case 'string':
|
||||||
$data['value'] = c::renderString($this->argument_value);
|
$data['value'] = c::renderString($this->argument_value);
|
||||||
break;
|
break;
|
||||||
|
case 'json':
|
||||||
|
if (is_object($this->argument_value)) {
|
||||||
|
$data['value'] = c::renderDictionary($this->argument_value);
|
||||||
|
} elseif (is_array($this->argument_value)) {
|
||||||
|
$data['value'] = c::renderArray($this->argument_value);
|
||||||
|
} else {
|
||||||
|
die('Unhandled');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'expression':
|
||||||
|
$data['value'] = c::renderExpression($this->argument_value);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,6 +72,18 @@ class IcingaCommandArgument extends IcingaObject
|
|||||||
$data['order'] = $this->sort_order;
|
$data['order'] = $this->sort_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->set_if) {
|
||||||
|
$data['set_if'] = c::renderString($this->set_if);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((int) $this->sort_order !== 0) {
|
||||||
|
$data['order'] = $this->sort_order;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->description) {
|
||||||
|
$data['description'] = c::renderString($this->description);
|
||||||
|
}
|
||||||
|
|
||||||
return c::renderDictionary($data);
|
return c::renderDictionary($data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user