Fixed length, lower, upper and mod AST functions to use platform for generating SQL
This commit is contained in:
parent
c1661dd53e
commit
494bfc8966
@ -41,8 +41,9 @@ class LengthFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'LENGTH(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getLengthExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,8 +41,9 @@ class LowerFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'LOWER(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getLowerExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,12 +42,10 @@ class ModFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'MOD('
|
||||
. $sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression)
|
||||
. ', '
|
||||
. $sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression)
|
||||
. ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getModExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->firstSimpleArithmeticExpression),
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->secondSimpleArithmeticExpression)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,8 +41,9 @@ class UpperFunction extends FunctionNode
|
||||
*/
|
||||
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
||||
{
|
||||
//TODO: Use platform to get SQL
|
||||
return 'UPPER(' . $sqlWalker->walkStringPrimary($this->stringPrimary) . ')';
|
||||
return $sqlWalker->getConnection()->getDatabasePlatform()->getUpperExpression(
|
||||
$sqlWalker->walkSimpleArithmeticExpression($this->stringPrimary)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user