Skip to content


DBAL-809: Decimal type: not convert to double variable type #2041

doctrinebot opened this Issue · 2 comments

2 participants


Jira issue originally created by user zhukv:


The doctrine DBAL type "decimal" not convert value to "double" variable type in PHP. And if use events for control changes set, we have a changes for field.

For example:

/*** Entity class ***/
/**** @ORM\Column(name="field", type="decimal")
private $field;

/*** Create entity ***/
$entity = new MyEntity();

/*** Load entity ***/
$entity = $em->field('MyEntity', 1);
var_dump($entity->getField()); // Then we have a string type
$entity->setField(1); // Set a integer type

Listener (onFlush):

$em = $event->getEntityManager();
$uow = $em->getUnitOfWork();

$entity = $event->getEntity();
$changes = $uow->getEntityChangeSet($entity);

var_dump($changes); // Changes exists, because variable type not equals


Comment created by zhukv:

Sorry, i not seen the attention section in docs:


Issue was closed with resolution "Can't Fix"

@doctrinebot doctrinebot added the Bug label
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.