IcingaArgument: enforce command object id on set

This commit is contained in:
Thomas Gelf 2016-05-02 11:10:47 +02:00
parent 31163b0708
commit d84369ce77
1 changed files with 3 additions and 1 deletions

View File

@ -82,7 +82,9 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
public function set($key, $value)
{
$argument = IcingaCommandArgument::create($this->mungeCommandArgument($key, $value));
$argument = IcingaCommandArgument::create(
$this->mungeCommandArgument($key, $value)
)->set('command_id', $this->object->id);
$key = $argument->argument_name;
if (array_key_exists($key, $this->arguments)) {
$this->arguments[$key]->replaceWith($argument);