mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
Merge pull request #3836 from Icinga/fix/query-double-execution
Fix double query execution
This commit is contained in:
commit
6ea012af7e
@ -450,7 +450,17 @@ class SimpleQuery implements QueryInterface, Queryable, Iterator
|
|||||||
*/
|
*/
|
||||||
public function hasResult()
|
public function hasResult()
|
||||||
{
|
{
|
||||||
return $this->iteratorPosition !== null || $this->fetchRow() !== false;
|
if ($this->iteratorPosition !== null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$hasResult = false;
|
||||||
|
foreach ($this as $row) {
|
||||||
|
$hasResult = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $hasResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user