catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

Medoo->dataMap() Bool dataType and database accepting null #732

Closed pedrofsantoscom closed 6 years ago

pedrofsantoscom commented 6 years ago

Hi there,

Found an issue that i don't know if it's the intended behaviour of the library. On the Medoo->dataMap() function, using the [Bool] dataType to auto convert the tinyint to bool php type, if i have that column on the database accepting null, the line: $stack[ $column_key ] = (bool) $data[ $column_key ]; will convert null to false. Is this your desired intent or is it possible to change that bool handling to handle null? $stack[ $column_key ] = (is_null($data[ $column_key ])) ? null : (bool) $data[ $column_key ];

Thanks

catfan commented 6 years ago

This have been fixed on v1.5.6. And check out the issue here #721.

pedrofsantoscom commented 6 years ago

I tried to find issues related before i posted but guess my search wasn't good. Thanks for the feedback 👍