IcingaObjectQuery: Use `$connection->renderFilter` instead of `whereToSql`

`whereToSql` did support timestamp handling in comparison, though this
class couldn't have made use of it since it had to use a query which
overrides the `isTimestamp` function.
This commit is contained in:
Johannes Meyer 2022-05-13 11:43:27 +02:00 committed by Thomas Gelf
parent 04c4bd2559
commit 3055552728
1 changed files with 2 additions and 13 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Module\Director\Data\Db;
use Icinga\Data\Db\DbQuery;
use Icinga\Data\Filter\Filter;
use Icinga\Exception\NotFoundError;
use Icinga\Exception\NotImplementedError;
use Icinga\Module\Director\Db;
@ -249,18 +250,6 @@ class IcingaObjectQuery
public function whereToSql($col, $sign, $expression)
{
return $this->dummyQuery()->whereToSql($col, $sign, $expression);
}
/**
* @return DbQuery
*/
protected function dummyQuery()
{
if ($this->dummyQuery === null) {
$this->dummyQuery = $this->connection->select();
}
return $this->dummyQuery;
return $this->connection->renderFilter(Filter::expression($col, $sign, $expression));
}
}