You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then when \Doctrine\DBAL\Connection binds values using Type::convertToDatabaseValue() any custom type, including Symfony\Uuid will be converted using STRING, INTEGER or ASCII convertToDatabaseValue(), not the type's one.
Current behavior
Eager relations refering to custom types are not loaded which leads to additional lazy queries
How to reproduce
Try eager loading when relation refers to column with any custom type, including uuid
Expected behavior
Custom types are bound to statement using convertToDatabaseValue(), not using __toString()
The text was updated successfully, but these errors were encountered:
Same for me and my custom Uuid implementation. Database type is binary and the php type is a string.
Relations with EAGER loading will always return an empty result. The parameter type is string without being converted to real binary database representation.
I'm affected by this issue too. With database type integer, mapped to custom value object PurchaseId, I'm getting error Object of class PurchaseId could not be converted to int
Bug Report
Summary
When eager relations are loaded by
BasicEntityPersister::loadAll()
orm/src/Persisters/Entity/BasicEntityPersister.php
Line 907 in cbb6c89
There only 3 options for array type - STRING, INTEGER and ASCII
orm/src/Persisters/Entity/BasicEntityPersister.php
Lines 1908 to 1912 in cbb6c89
So any custom type will be narrowed to one of those types, based on
Type::getBindingType()
or will fail.Then when
\Doctrine\DBAL\Connection
binds values usingType::convertToDatabaseValue()
any custom type, including Symfony\Uuid will be converted using STRING, INTEGER or ASCIIconvertToDatabaseValue()
, not the type's one.Current behavior
Eager relations refering to custom types are not loaded which leads to additional lazy queries
How to reproduce
Try eager loading when relation refers to column with any custom type, including uuid
Expected behavior
Custom types are bound to statement using
convertToDatabaseValue()
, not using__toString()
The text was updated successfully, but these errors were encountered: