IcingaObjectImports: allow for multicol relations

This commit is contained in:
Thomas Gelf 2015-12-10 11:43:54 +01:00
parent d055c68a5c
commit 1cd0b0f4cb
1 changed files with 6 additions and 1 deletions

View File

@ -158,7 +158,12 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
if ($import instanceof $class) {
$this->imports[$import->object_name] = $import;
} elseif (is_string($import)) {
$import = $class::load($import, $connection);
if (is_array($this->object->getKeyName())) {
// Services only
$import = $class::load(array('object_name' => $import), $connection);
} else {
$import = $class::load($import, $connection);
}
$this->imports[$import->object_name] = $import;
}