cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Phalcon\Mvc\Collection findFirst() method returns invalid document

Open lobostome opened this issue 13 years ago • 5 comments

I have a Phalcon\Mvc\Collection model called User. When I try to get a user by their email like this

User::findFirst(array("conditions" => array("email" => $email)));

I get two different results. If the variable $email contains an email present in the database, I get a result as expected. However, if the variable $email does NOT contain an email that is present in the database, I get an "Invalid document" message.

lobostome avatar Dec 21 '12 22:12 lobostome

Hi, I added a fix for this in 0.8.0, thank you

ghost avatar Dec 21 '12 23:12 ghost

Works great now. Thank you so much for the quick fix.

lobostome avatar Dec 22 '12 00:12 lobostome

It looks like this issue has reappeared in 0.8.0a2.

lobostome avatar Dec 26 '12 06:12 lobostome

Hi, 0.8.0a2 isn't released yet, can you check your version this way?

echo Phalcon\Version::get();

ghost avatar Dec 26 '12 16:12 ghost

You are right. It says 0.8.0 ALPHA 1. I was going by the change log.

I did another pull. It is fixed now with version 0.8.0 ALPHA 2.

Thank you so much.

lobostome avatar Dec 26 '12 23:12 lobostome