cphalcon
cphalcon copied to clipboard
[BUG] Syntax error, unexpected token AS, near to ' [c]'
Using: $builder = $this->modelsManager ->createBuilder() ->from(array('b' => 'Apps\Models\Blog\Blog')) ->columns(array('b.id',)) ->join('Apps\Models\Social\Comment', 'b.id = c.id', 'c'); $result = $builder->getQuery()->execute();
I get PhalconException: Syntax error, unexpected token AS, near to ' [c]'
echo $builder->getPhql();
The generated phql is: SELECT b.id FROM [Apps\Models\Blog\Blog] AS [b] JOIN [Apps\Models\Social\Comment] ON b.id = c.id AS [c]
But the expected result is: SELECT b.id FROM [Apps\Models\Blog\Blog] AS [b] JOIN [Apps\Models\Social\Comment] AS [c] ON b.id = c.id
This is fixed in the 1.0.0 branch, thanks!