Skip to content

Commit 154521c

Browse files
committed
It is now possible to use a Builder\Select as a parameter for a where-IN-clause
1 parent c521e5d commit 154521c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Databases/MySQL.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ public function quoteExpression($expression, array $arguments = array()) {
158158
public function quote($value) {
159159
if(is_null($value)) {
160160
$result = 'NULL';
161+
} elseif($value instanceof Builder\Select) {
162+
$result = sprintf('(%s)', (string) $value);
161163
} elseif(is_array($value)) {
162164
$result = join(', ', array_map(function ($value) { return $this->quote($value); }, $value));
163165
/*} elseif(is_int(trim($value)) && strpos('123456789', substr(0, 1, trim($value))) !== null) {

0 commit comments

Comments
 (0)