Skip to content

Commit

Permalink
Fixed DbDriver::findAllByColumn() which used to reuse the same object…
Browse files Browse the repository at this point in the history
… all the time
  • Loading branch information
crocodile2u committed May 29, 2017
1 parent 003129e commit 7dff7f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/persistence/DbDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function findAllByColumn($column, $value, Entity $proto, $limit = null)
$sql = "SELECT * FROM {$proto->getSourceName()} WHERE {$column} = ?";
$stmt = $this->db->prepare($sql);
$stmt->execute([$value]);
$stmt->setFetchMode(\PDO::FETCH_INTO, $proto);
$stmt->setFetchMode(\PDO::FETCH_CLASS, get_class($proto));
while ($item = $stmt->fetch()) {
yield $item;
}
Expand Down

0 comments on commit 7dff7f4

Please sign in to comment.