When I have my DQL query from a table in my database and return var_dump() for example the ID of the row it’ll be type of string, despite the fact it is an unsigned INT(10) in the DB, which is very annoying when I want to echo json_encode($row->toArray());. Every integer will be wrapped in quotation marks.
How can I instruct Doctrine to cast types properly and not leave them “as is” like described here: http://www.doctrine-project.org/jira/browse/DC-769
I found out that the Doctrine version I was actually using (v1.2.8 installed via APT) was too old to handle this feature. When I updated to Doctrine 2 my described problem was solved.
You should consider an update if you have the same issue, but be aware of the changes that were made from Doctrine1 to Doctrine2! Migration could take some time.