lox / pheasant

A lightweight data mapper designed to take advantage of PHP 5.3+
http://getpheasant.com
MIT License
101 stars 21 forks source link

`::findByParam(array())` throws mysql exception #107

Closed Jud closed 9 years ago

Jud commented 10 years ago

Currently:

DomainObject::findById(array());

Throws a mysql exception since the sql translates to where id in (). After searching around, I found this stackoverflow post which suggests using IN (null) since even null == null is always false.

Would be easy to just test for this case in $binder->reduce. I can make a PR, but wanted to make sure you guys aren't already dealing with this through a different method.

bjornpost commented 9 years ago

Fixed in c0353fe.