From 9912db806361ad92e22da4ac00d7fade985f701f Mon Sep 17 00:00:00 2001 From: COLE Edouard Date: Wed, 22 Mar 2017 16:52:57 +0100 Subject: [PATCH 1/2] Keep track of full qualified type name when dealing with collections Conflicts: lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php --- lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 7ab1d3b1c2c..c50728aa58e 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -1902,7 +1902,7 @@ private function getTypes($field, $value, ClassMetadata $class) if (is_array($value)) { return array_map( function ($type) { - return Type::getType($type)->getBindingType() + Connection::ARRAY_PARAM_OFFSET; + return '[' . $type . ']'; }, $types ); From b45d3f6baa2c314a16be085f11616f56fdf256a7 Mon Sep 17 00:00:00 2001 From: COLE Edouard Date: Wed, 22 Mar 2017 17:10:09 +0100 Subject: [PATCH 2/2] Add support for array nested types Conflicts: lib/Doctrine/ORM/Query/ParameterTypeInferer.php --- lib/Doctrine/ORM/Query/ParameterTypeInferer.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php index a12a559a730..763743d9064 100644 --- a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php +++ b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php @@ -58,9 +58,7 @@ public static function inferType($value) } if (is_array($value)) { - return is_integer(current($value)) - ? Connection::PARAM_INT_ARRAY - : Connection::PARAM_STR_ARRAY; + return '[' . static::inferType(current($value)) . ']'; } return \PDO::PARAM_STR;