IcingaObjectMultiRelations(Legacy): add toLegacyConfigString

refs #12919
This commit is contained in:
Markus Frosch 2016-10-14 15:42:29 +02:00
parent a804874a54
commit 3f53285566
1 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,7 @@ use Iterator;
use Countable; use Countable;
use Icinga\Module\Director\IcingaConfig\IcingaConfigRenderer; use Icinga\Module\Director\IcingaConfig\IcingaConfigRenderer;
use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c; use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c;
use Icinga\Module\Director\IcingaConfig\IcingaLegacyConfigHelper as c1;
class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRenderer class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRenderer
{ {
@ -414,4 +415,15 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen
} }
} }
} }
public function toLegacyConfigString()
{
$relations = array_keys($this->relations);
if (empty($relations)) {
return '';
}
return c1::renderKeyValue($this->propertyName, c1::renderArray($relations));
}
} }