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

something about findFirst/find method

Why phalcon orm does not support find prototype like this?

Model::find(
    array(
        'filed' => 'value',
        'field2' => 'value2'
    )
);

Doctrine ORM supports this and I can make a range quey like this

Model::find(
    'id' => array(1, 2, 3)
);

But in Phalcon ORM I must write like this

Model::find(array(
    'id in (1, 2, 3)'
))

You can simply use Doctrine instead of Phalcon ORM if you are comfortable with that.

edited Mar '14

You could simply use this format:

Model::find(array('filed1 = ?0 AND filed2 = ?1', 'bind'=> array($value1, $value2)));

The advantage comes when you have special expressions, where with doctrine you can't do it withouth building a query.

Model::find(array('filed1 = ?0 AND filed2 < NOW() , 'bind'=> array($value1)));

In addition, you could extend the find method easily to work the way you would like to. I extended mine to support caching for example.