Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Phalcon Model Inner Join

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



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

this should be working

https://docs.phalconphp.com/en/latest/api/Phalcon%5Mvc%5Model%5Query%5Builder.html



5.3k
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.