mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-26 11:19:16 +02:00
IcingaObjectFieldLoader: do not fail on emtpy...
...parents
This commit is contained in:
parent
9e977eaf9a
commit
e04acbc55f
@ -146,16 +146,17 @@ class IcingaObjectFieldLoader
|
|||||||
|
|
||||||
protected function loadDataFieldsForObjects($objectList)
|
protected function loadDataFieldsForObjects($objectList)
|
||||||
{
|
{
|
||||||
if (empty($objectList)) {
|
|
||||||
// Or should we fail?
|
|
||||||
return array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$ids = array();
|
$ids = array();
|
||||||
$objects = array();
|
$objects = array();
|
||||||
foreach ($objectList as $object) {
|
foreach ($objectList as $object) {
|
||||||
$ids[] = $object->id;
|
if ($object->hasBeenLoadedFromDb()) {
|
||||||
$objects[$object->id] = $object;
|
$ids[] = $object->id;
|
||||||
|
$objects[$object->id] = $object;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($ids)) {
|
||||||
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$connection = $object->getConnection();
|
$connection = $object->getConnection();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user