From 4a838ca277161632555a07a604124600ed420170 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 15 Nov 2016 16:36:48 +0100 Subject: [PATCH] IcingaHostGroup(Legacy): Load zones prefetched refs #13049 --- library/Director/Objects/IcingaHostGroup.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/Director/Objects/IcingaHostGroup.php b/library/Director/Objects/IcingaHostGroup.php index be5f8552..148559e9 100644 --- a/library/Director/Objects/IcingaHostGroup.php +++ b/library/Director/Objects/IcingaHostGroup.php @@ -61,10 +61,9 @@ class IcingaHostGroup extends IcingaObjectGroup // make sure we write to all zones // so host -> group relations are still possible - foreach (IcingaZone::loadAll($conn) as $zone) { - $zoneId = $zone->getAutoincId(); - if (! array_key_exists($zoneId, $zoneMap)) { - $zoneMap[$zoneId] = array(); + foreach (IcingaObject::loadAllByType('zone', $conn) as $zone) { + if (! array_key_exists($zone->id, $zoneMap)) { + $zoneMap[$zone->id] = array(); } }