mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
SELECT NEW fails with ArrayType #5160
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dbalabka on GitHub (Jun 20, 2016).
In case when we use
SELECT NEWand trying to inject field with ArrayType we get herehttps://github.com/doctrine/doctrine2/blob/2.4/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php#L299
following warning:
because value already have been converted into array here:
https://github.com/doctrine/doctrine2/blob/2.4/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php#L292
As quick solution I have fixed ArrayType::convertToPHPValue to return
$valueif it already converted.https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Types/ArrayType.php#L53
Doctrine ORM version: 2.4.8