From 3f532855663f72432bb39e18fc878c7b8296a73b Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Fri, 14 Oct 2016 15:42:29 +0200 Subject: [PATCH] IcingaObjectMultiRelations(Legacy): add toLegacyConfigString refs #12919 --- .../Director/Objects/IcingaObjectMultiRelations.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/Director/Objects/IcingaObjectMultiRelations.php b/library/Director/Objects/IcingaObjectMultiRelations.php index 5413d75a..0d0a1a54 100644 --- a/library/Director/Objects/IcingaObjectMultiRelations.php +++ b/library/Director/Objects/IcingaObjectMultiRelations.php @@ -8,6 +8,7 @@ use Iterator; use Countable; use Icinga\Module\Director\IcingaConfig\IcingaConfigRenderer; use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c; +use Icinga\Module\Director\IcingaConfig\IcingaLegacyConfigHelper as c1; 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)); + } }