Affects Version/s: None
Fix Version/s: 1.2.0-BETA1
Environment:Fedora 10, symfony 1.2, php 5.2.9, postgresql 8.4.1, can't tell what version of Doctrine I have.
I didn't set a value into a boolean column, reckoning that null would count as false.
But saving the record fails validation, and this appears to be because Doctrine_Validator::isValidType contains
return is_bool($var) || (is_numeric($var) && ($var == 0 || $var == 1));
So it will not accept a null value, and furthermore reports the failure not as a data error but (confusingly) as a type error.
I checked the documentation to see if it said that I could not use a null value (I would regard this as an unnecessary restriction, but at least if it were documented, that would be consistent).
On the contrary, the Doctrine ORM book, Chapter 7, in the 'Boolean' section, says "Ternary logic is possible by using null as the third possible value that may be assigned to fields of this type."!
Add this to the fact that I haven't found any documentation about using Doctrine_Validator_Exception - not even API documentation, and I am not impressed with my first experiences with Doctrine.