We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Phalcon 2.0 - Phalcon\Mvc\Model\Query Issue With Joins


I am in the process of upgrading from Phalcon 1.3.5 to Phalcon 2.0.0. Most of the process was fine, but I came across a blocker with Phalcon\Mvc\Model\Query.


In TestController.php, there are three queries. The second query always returns false while the first and third always returns true.

I am able to reproduce this issue against the 2.0.0 branch, and also the 2.0.0 tag. I cannot reproduce the issue against the 1.3.5 branch.

Am I doing something incorrectly with the Query builder?


Could you please post this on Github?

edited Apr '15

Have you tried changing

->columns('Office., Address.')

to this:

->columns(['Office.', 'Address.'])

In the Query Builder Docs the examples show a string being used as the paramter only when a single column parameter (including "*") is requested. When multiple column parameters are requested, it uses an array of columns.


// 'SELECT * FROM Robots';
$phql = $builder->columns('*')

// 'SELECT id FROM Robots';

// 'SELECT id, name FROM Robots';
$builder->columns(array('id', 'name'))


Yes, I have tried that. Supplying the columns as an array of fields results in the same behavior.