IcingaHostGroup(Legacy): Load zones prefetched

refs #13049
This commit is contained in:
Markus Frosch 2016-11-15 16:36:48 +01:00 committed by Thomas Gelf
parent c2734fd4d4
commit 4a838ca277
1 changed files with 3 additions and 4 deletions

View File

@ -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();
}
}