2009-03-23 20:39:33 +03:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Doctrine\ORM\Query\AST\Functions;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* "LOWER" "(" StringPrimary ")"
|
|
|
|
*
|
|
|
|
* @author robo
|
|
|
|
*/
|
|
|
|
class LowerFunction extends FunctionNode
|
|
|
|
{
|
|
|
|
private $_stringPrimary;
|
|
|
|
|
|
|
|
public function getStringPrimary()
|
|
|
|
{
|
|
|
|
return $this->_stringPrimary;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
|
|
|
|
{
|
|
|
|
//TODO: Use platform to get SQL
|
|
|
|
return 'LOWER(' . $sqlWalker->walkStringPrimary($this->_stringPrimary) . ')';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @override
|
|
|
|
*/
|
|
|
|
public function parse(\Doctrine\ORM\Query\Parser $parser)
|
|
|
|
{
|
|
|
|
$lexer = $parser->getLexer();
|
|
|
|
$parser->match($lexer->lookahead['value']);
|
|
|
|
$parser->match('(');
|
2009-06-14 21:34:28 +04:00
|
|
|
$this->_stringPrimary = $parser->StringPrimary();
|
2009-03-23 20:39:33 +03:00
|
|
|
$parser->match(')');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|