Skip to content

Commit

Permalink
Fix instances of FluentLiteral not taken literally in where
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornhoft committed Oct 12, 2017
1 parent 46be804 commit 33c9f3f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion FluentPDO/CommonQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@ public function where($condition, $parameters = array()) {
return $this->addStatement('WHERE', "$condition IN $in");
}

$condition = "$condition = ?";
// don't parameterize the value if it's an instance of FluentLiteral
if ($parameters instanceof FluentLiteral) {
$condition = "{$condition} = {$parameters}";

return $this->addStatement('WHERE', $condition);
}
else {
$condition = "$condition = ?";
}
}

array_shift($args);
Expand Down

0 comments on commit 33c9f3f

Please sign in to comment.