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.

"in" clause in find() using a model relationship

OK so I read this:

and it appears that as of 2.0 Phalcon supports binding using an "in" clause. I have two models, model A and model B, which are related:

class A
    public function initialize(){


in a controller:

$result = A->getMyA(array("conditions"=>"field1 in (:param:)","bind"=>array("param"=>array(1,2,3))));

And I get this error: "SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens"

What am I doing wrong?


You just wrote it wrong:

$result = A->getMyA(array("conditions"=>"field1 in {param:array})","bind"=>array("param"=>array(1,2,3))));