IcingaCommandArgument: first rendering implementation

This commit is contained in:
Thomas Gelf 2015-10-16 18:42:38 +02:00
parent 0a0015f96a
commit ccf8e6fa78
1 changed files with 20 additions and 0 deletions

View File

@ -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);
}
}