mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1091: Parser::FunctionsReturningStrings() doesn't check for custom DQL functions. #1363
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Mar 31, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user iksela:
I defined a custom DQL FunctionNode that wasn't detected by the Parser.
Problem was in the Parser::FunctionsReturningStrings(), but I suspect the problem is more general.
Here's my (ugly) fix:
public function FunctionsReturningStrings()
{
$funcNameLower = strtolower($this->_lexer->lookahead['value']);
if (isset(self::$_STRING_FUNCTIONS[$funcNameLower])) {
$funcClass = self::$_STRING_FUNCTIONS[$funcNameLower];
$function = new $funcClass($funcNameLower);
$function->parse($this);
}
else $function = $this->CustomFunctionsReturningStrings();
I include the custom DQL FunctionNode created.
@doctrinebot commented on GitHub (May 1, 2011):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (May 1, 2011):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/af75b56e37ac54349a45