ramsey / uuid-doctrine

:snowflake::file_cabinet: Allow the use of a ramsey/uuid UUID as Doctrine field type.
MIT License
888 stars 84 forks source link

Cannot bind uuid_binary type to Doctrine's QueryBuilder #266

Open subdee opened 2 months ago

subdee commented 2 months ago

Description

A BINARY type does not seem to be supported in doctrine now.

If I bind the binary representation of the ID in a param I get an error from the ORM.

This is the parameter:

->setParameter(':column', $entity->getId()->getBytes())

and the error is Unhandled match case 16 which is coming from this method in doctrine/orm and is simply missing a match for ParameterType::BINARY.

Adding the type explicitly results in the same error.

doctrine/orm: 3.1.3 doctrine/dbal: 3.8.4 ramsey/uuid-doctrine: 2.0.0

Edit: The above worked fine with doctrine/orm: 2.19.4 doctrine/dbal: 3.8.3 ramsey/uuid-doctrine: 1.8.2 where the above method does not exist

Steps to reproduce

Use the QueryBuilder to retrieve data based on a foreign key with uuid_binary type

Expected behavior

To get the right data back from the database

Screenshots or output

Error is Unhandled match case 16

Environment details

doctrine/orm: 3.1.3 doctrine/dbal: 3.8.4 ramsey/uuid-doctrine: 2.0.0

Additional context

sakalys commented 2 weeks ago

Can confirm. This renders doctrine v3 not yet usable when the project is using uuids.