Skip to content

Commit

Permalink
Merge pull request #1 from LordWeedlle/array-identifier
Browse files Browse the repository at this point in the history
Keep track of full qualified type name when dealing with collections
  • Loading branch information
Beny13 authored Apr 12, 2017
2 parents e6c4341 + b45d3f6 commit 68ff083
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
4 changes: 1 addition & 3 deletions lib/Doctrine/ORM/Query/ParameterTypeInferer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 68ff083

Please sign in to comment.