Can you try this? $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->field = $parser->StringExpression(); // <-- $parser->match(Lexer::T_COMMA); $this->value = $parser->StringPrimary(); $parser->match(Lexer::T_CLOSE_PARENTHESIS);
If this doesn't work, can you explain _what_ isn't working? Not getting the expected result? Then what did you expect, and what was the actual result? Getting an error message? What is the message? -- Jasper N. Brouwer (@jaspernbrouwer) On 26 May 2014 at 14:51:11, Gianvito Pio ([email protected]) wrote: > It actually seems that I have this problem with all the Doctrine > functions... LOWER was just one...and ILIKE has the same problem. > I implemented both LIKE and ILIKE through a custom function and now also > LIKE does not work. > > Here is the code: > > class Ilike extends FunctionNode { > > protected $field; > protected $value; > > public function parse(\Doctrine\ORM\Query\Parser $parser) > { > $parser->match(Lexer::T_IDENTIFIER); > $parser->match(Lexer::T_OPEN_PARENTHESIS); > $this->field = $parser->StringPrimary(); > $parser->match(Lexer::T_COMMA); > $this->value = $parser->StringPrimary(); > $parser->match(Lexer::T_CLOSE_PARENTHESIS); > } > > public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) > { > return $this->field->dispatch($sqlWalker) . ' ILIKE ' . > $this->value->dispatch($sqlWalker); > } > } > > Do you see something strange that can cause the problem? > > Thank you -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
