EDIT: This was simply confirmed as a bug in Doctrine 2 http://www.doctrine-project.org/jira/browse/DDC-1112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15724 # action_15724
I have a Doctrine 2 object and the value is displayed this way (with the usual getter / setter):
protected $someValue; public function getSomeValue() { return $this->someValue; } public function setSomeValue($someValue) { $this->someValue = $someValue; }
When I set this value from my code, the value is written to the database correctly. But, and this is my problem, when I get the value (via getter or \Doctrine\Common\Util\Debug::dump()
), it always gives me a number with a maximum of 14 digits, and it rounds the value. I read the default findById()
entry.
eg: with value 1234567890.012345678901234567890123456789 I have 1234567890.0123 eg: with value 890.0123456789012345678901234567890123456 I have 890.01234567890
Of course, I want all the numbers, not just 14. The field in MySQL is declared as follows:
someValue decimal(40,30) NOT NULL,
When I get the value with raw PHP and mysql_query (), it returns correctly.
Edit : It seems the problem is that Doctrine returns a float:
["someValue":protected]=> float(234567890.01235)
What's wrong, what should I check next, how to fix any hints?
source share