From ccf8e6fa780a225a3101fc22ad9ad7d1b4ed497c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 16 Oct 2015 18:42:38 +0200 Subject: [PATCH] IcingaCommandArgument: first rendering implementation --- .../Objects/IcingaCommandArgument.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/library/Director/Objects/IcingaCommandArgument.php b/library/Director/Objects/IcingaCommandArgument.php index 2c856875..e23c9efb 100644 --- a/library/Director/Objects/IcingaCommandArgument.php +++ b/library/Director/Objects/IcingaCommandArgument.php @@ -2,6 +2,8 @@ namespace Icinga\Module\Director\Objects; +use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c; + class IcingaCommandArgument extends IcingaObject { protected $keyName = 'id'; @@ -37,4 +39,22 @@ class IcingaCommandArgument extends IcingaObject { // No log right now, we have to handle "sub-objects" } + + public function toConfigString() + { + $data = array(); + if ($this->argument_value) { + switch ($this->argument_format) { + case 'string': + $data['value'] = c::renderString($this->argument_value); + break; + } + } + + if ($this->sort_order) { + $data['order'] = $this->sort_order; + } + + return c::renderDictionary($data); + } }