IcingaObjectMultiRelations(Legacy): add toLegacyConfigString
refs #12919
This commit is contained in:
parent
a804874a54
commit
3f53285566
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue