We are using Symfony to create some webservices. We use Doctrine-ORM to store entities and Doctrine-DBAL to retrive data because it's very light and can reuse the ORM (entity manager) connection.
When using Doctrine-DBAL, integer values are returned to PHP as strings and we want to have integer values, specially because they are retured to Javascript. Following this discussion How to get numeric types from MySQL using PDO? we have installed mysql native driver sudo apt-get install php5-mysqlnd
and setup our symfony (dbal) configuration with PDO::ATTR_EMULATE_PREPARE = false :
doctrine:
dbal:
.
.
options:
20 : false # PDO::ATTR_EMULATE_PREPARES is 20
With this configuration we are getting integers when mysql fields are integers. So far so good.
But there is a new problem: When storing entities with boolean values through Doctrine-ORM the entity is not persisted. We see in the logs the INSERT and the COMMIT, but the record is not in the database (if we use a table with no boolean fields defined in the entity, the record is stored).
Furthermore, we don't get any Error or Exception, so we find this very dangerous. We think there is a bug in the PDO library but we have to look a bit more into it.
The question: Has anybody experienced this behaviour? any workaround? Should Doctrine account for this?