Bonjour je suis en train d'implémenter une fonction DQL perso afin de trouver les adresses contenu dans un périmètre.
Je me suis inspiré de http://www.lexik.fr/blog/symfony/doc...doctrine2-1624
je veux pouvoir utiliser ma fonction comme suit:
->andWhere('INRANGE( (a.latitude,a.longitude), ( :latitude, :longitude ),20 )')
et j'ai mis dans ma classe InRAnge
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
public function parse(Parser $parser)
{
$parser->match(Lexer::T_IDENTIFIER);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->latitude2 = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->longitude2 = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(Lexer::T_COMMA);
$parser->match(Lexer::T_OPEN_PARENTHESIS);
$this->latitude1 = $parser->ArithmeticExpression();
$parser->match(Lexer::T_COMMA);
$this->longitude1 = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
$parser->match(Lexer::T_COMMA);
$this->range = $parser->ArithmeticExpression();
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
} |
C'est cette fonction qui me génère une erreur, car je ne parse pas correctement mon expression
mon erreur
[Syntax Error] line 0, col -1: Error: Expected =, <, <=, <>, >, >=, !=, got end of string.
Merci pour votre aide
Partager