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

Joins

How can I set the type of JOIN (ex. left or right)?



98.9k
$result = $this->modelsManager->query("SELECT * FROM Robots LEFT JOIN RobotsParts");

Got "Fatal error: Call to undefined method Phalcon\Mvc\Model\Manager::query()"



98.9k

Sorry, it must be:

$result = $this->modelsManager->executeQuery("SELECT * FROM Robots LEFT JOIN RobotsParts");

https://docs.phalcon.io/en/1.0.0/reference/phql.html#joins https://docs.phalcon.io/en/1.0.0/reference/phql.html#creating-queries-using-the-query-builder