1
0
mirror of synced 2025-02-20 22:23:14 +03:00

Centralize InputParameter SQL generation.

This commit is contained in:
Guilherme Blanco 2013-08-19 00:33:45 -04:00
parent 43fc8bafa7
commit cc83ac6ce8

View File

@ -1954,9 +1954,7 @@ class SqlWalker implements TreeWalker
// Handle InputParameter mapping inclusion to ParserResult
if ($expression instanceof AST\InputParameter) {
$this->parserResult->addParameterMapping($expression->name, $this->sqlParamIndex++);
return '?' . $comparison;
return $this->walkInputParameter($expression) . $comparison;
}
return $expression->dispatch($this) . $comparison;
@ -2094,10 +2092,7 @@ class SqlWalker implements TreeWalker
$sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE ';
if ($likeExpr->stringPattern instanceof AST\InputParameter) {
$inputParam = $likeExpr->stringPattern;
$dqlParamKey = $inputParam->name;
$this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++);
$sql .= '?';
$sql .= $this->walkInputParameter($likeExpr->stringPattern);
} elseif ($likeExpr->stringPattern instanceof AST\Functions\FunctionNode) {
$sql .= $this->walkFunction($likeExpr->stringPattern);
} elseif ($likeExpr->stringPattern instanceof AST\PathExpression) {