Skip to content

Commit 15d2c00

Browse files
committed
add $withValues param for getSql() method
1 parent 2180965 commit 15d2c00

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/QueryBuilder.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ public function addSemicolon(string $sql = ''): string
5353
return $new_sql;
5454
}
5555

56-
/**
57-
* @return string
58-
*/
59-
public function getSql(): string
56+
/**
57+
* @param bool $withValues
58+
* @return string
59+
*/
60+
public function getSql(bool $withValues = true): string
6061
{
6162
$sql = $this->sql;
6263

63-
if (!empty($this->params)) {
64+
if (!empty($this->params) && $withValues) {
6465
foreach ($this->params as $param) {
6566
if (is_string($param)) {
6667
$sql = str_replace('?', "'{$param}'", $sql);

0 commit comments

Comments
 (0)