We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon Model Inner Join

Can any one share example of inner join using phalcon model query.



85.5k

MyModel::query()
->join('Robots', 'r.id = RobotsParts.robots_id', 'r', 'INNER');
->execute();

this should be working

https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_Model_Query_Builder.html



14.7k
Accepted
answer

Thanks but it will give result after modifiying to this if you are using namespaces in models

MyModel::query()->join('path\to\your\Model', 'r.id=path\to\your\second\Model','r','INNER')->execute();

**My Model represents the model (table) from which you want to get data from.