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

new Criteria and "from"

I noticed that Phalcon\Mvc\Model\Criteria doesn't have a from() method. It does have a join() method though.

join() in Criteria.php is defined like this (alias is passable):


public function join($model, $conditions = null, $alias = null, $type = null) {}

So, how is one supposed to create an alias for the main model when joining related model?

Current result is always this kind of error:

"The column 'whatever_id' is ambiguous, when preparing: SELECT..."

Can one actually use this kind of statement?


SomeModel::find($criteria->getParams());
edited May '16

Criteria is object used for finding using classes. It doesn't have from beacause of that beacause doing SomeModel::find you are already doing from. If you need from use modelsManager.

If you need aliases etc use modelsManager.