This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Description
In dependant doctrine library, a DECIMAL column is now bound to php type string. Therefore, retrieving such a column will return a string, ie a number properly formatted. However, once the column has been set, a float will be returned as long as the object is cached. Future queries will return a string again.
Example
// table `foo` containing column `bar`: DECIMAL(10,2)
$fooBean = $fooDao->getById(1);
echo $fooBean->getBar();
// "4.20"
$fooBean->setBar(4.1);
echo $fooBean->getBar();
// 4.1
$fooBean->setBar("4.10");
echo $fooBean->getBar();
// 4.1
The issues inferred are both an approximative precision and an unstable number format.
(cd doctrine/dbal: 9f51afa2)
Edit: typing error corrected