From af3591fbca0610c3c8b9859efe5fae79214b7fe1 Mon Sep 17 00:00:00 2001 From: Alessandro Frangioni <> Date: Mon, 5 Jun 2017 11:47:15 +0200 Subject: [PATCH] Fixes #5804 --- lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 6af159fc7..3c502e3d7 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -344,9 +344,13 @@ class BasicEntityPersister implements EntityPersister . ' FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; + $types = []; + foreach ($identifier as $fieldName) { + $types[] = $versionedClass->fieldMappings[$fieldName]['type']; + } $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id); - $value = $this->conn->fetchColumn($sql, array_values($flatId)); + $value = $this->conn->fetchColumn($sql, array_values($flatId), 0, $types); return Type::getType($fieldMapping['type'])->convertToPHPValue($value, $this->platform); }