From ab4728ad5430273f3ea3e0790b30274c124f4d9f Mon Sep 17 00:00:00 2001 From: raviks789 <33730024+raviks789@users.noreply.github.com> Date: Tue, 15 Feb 2022 12:38:48 +0100 Subject: [PATCH] Use ipl\Stdlib\Filter to filter the $queryHost and $queryService --- library/Businessprocess/State/IcingaDbState.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/Businessprocess/State/IcingaDbState.php b/library/Businessprocess/State/IcingaDbState.php index cd931ec..a55ffc3 100644 --- a/library/Businessprocess/State/IcingaDbState.php +++ b/library/Businessprocess/State/IcingaDbState.php @@ -11,6 +11,7 @@ use Icinga\Module\Icingadb\Common\Auth; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\Service; use ipl\Sql\Connection as IcingaDbConnection; +use ipl\Stdlib\Filter; class IcingaDbState { @@ -67,8 +68,7 @@ class IcingaDbState $queryHost = Host::on($this->backend)->with('state'); IcingaDbObject::applyIcingaDbRestrictions($queryHost); - $queryHost->getSelectBase() - ->where(['host.name IN (?)' => $hosts]); + $queryHost->filter(Filter::equal('host.name', $hosts)); $hostObject = $queryHost->getModel()->getTableName(); @@ -82,8 +82,7 @@ class IcingaDbState 'host.state' ]); - $queryService->getSelectBase() - ->where(['service_host.name IN (?)' => $hosts]); + $queryService->filter(Filter::equal('host.name', $hosts)); IcingaDbObject::applyIcingaDbRestrictions($queryService);