IcingaDbState: Fix postgres support

-.-
This commit is contained in:
Johannes Meyer 2023-08-09 14:10:37 +02:00
parent ffab7edcb3
commit 1d08c954ba

View file

@ -92,7 +92,7 @@ class IcingaDbState
$serviceIds = [];
$serviceResults = [];
foreach ($this->backend->yieldAll($services->assembleSelect()) as $row) {
$row->hex_id = bin2hex($row->id);
$row->hex_id = bin2hex(is_resource($row->id) ? stream_get_contents($row->id) : $row->id);
$serviceIds[] = $row->hex_id;
$serviceResults[] = $row;
}
@ -120,7 +120,7 @@ class IcingaDbState
$hostIds = [];
$hostResults = [];
foreach ($this->backend->yieldAll($hosts->assembleSelect()) as $row) {
$row->hex_id = bin2hex($row->id);
$row->hex_id = bin2hex(is_resource($row->id) ? stream_get_contents($row->id) : $row->id);
$hostIds[] = $row->hex_id;
$hostResults[] = $row;
}