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

Find model based on value of foreign key (one-to-one, and/or one-to-many

I can't find out through the documentation, but is there a way using Model::find(); to supply the value of a foreign key versus having to filter on the field itself?

IE, I have a table Job, that has a field: status_id, which is a relationship to the Status model. I want to be able to find all Jobs whose status is 'In Progress' (the status table is simply id, name).

$users = Users::findFirst( 123 );
$jobs = $users->getJobs( ['conditions'=>'status_id=?0','bind'=>[''in_progress']]  );