Skip to content

Commit

Permalink
SimpleQuery: Clone internal cache & reset iterator state
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Jul 26, 2023
1 parent f00b9d6 commit 3b05583
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Icinga/Data/SimpleQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,15 @@ public function getColumns()
}

/**
* Deep clone self::$filter
* Deep clone self::$filter and self::ds
*/
public function __clone()
{
$this->filter = clone $this->filter;
$this->ds = clone $this->ds;

$this->iterator = null;
$this->iteratorPosition = null;
$this->cachedCount = 0;
}
}

0 comments on commit 3b05583

Please sign in to comment.