diff --git a/model/SQLMap.php b/model/SQLMap.php index af6d7323c..5e997e788 100644 --- a/model/SQLMap.php +++ b/model/SQLMap.php @@ -38,8 +38,10 @@ class SQLMap extends Object implements IteratorAggregate { public function getItem($id) { if($id) { $baseTable = reset($this->query->from); - $this->query->where[] = "$baseTable.\"ID\" = $id"; + $where = "$baseTable.\"ID\" = $id"; + $this->query->where[sha1($where)] = $where; $record = $this->query->execute()->first(); + unset($this->query->where[sha1($where)]); if($record) { $className = $record['ClassName']; $obj = new $className($record);