julien-c/mongovel — pull request #9 by arthurdarcet (2013-05-07 08:45:07+00:00)
Title: Throw InvalidArgumentException when calling findOne or findOneOrFail with an invalid condition array

This prevent a PHP warning when `Model::findOne` is called with a string not corresponding to a MongoId.

Doing this in `handleParameters` isn't an option since `handleParameters` is called by `Model::__callStatic` on it's first argument before dispatching to the raw MongoCollection, and when `Model::distinct` is called the first argument is the field name, not a MongoId or an array.