ramsey / uuid-doctrine

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

Supportfor typed property. #177

Open Legion112 opened 2 years ago

Legion112 commented 2 years ago

Mapping configuration via typed property

Remove @ORM\Columm(type="uuid") to minimize effort on configuration.

Background/problem

Redundant info of typed property and annotation.

image

Proposal/solution

Doctrine support getting type from typed property like so:

image

Alternatives

Additional context

This is an optional way to configure the mapping

ramsey commented 1 year ago

I don't understand the request for this enhancement. Should this lead to a change in the library code, or is this something that needs to be added to the examples in the README?

Legion112 commented 1 year ago

I think it was clear that with PHP 7.4 classes have a typed property and you don't need to define type imperativly as it might be extracted from the type.

This have to be supported in this library.

https://www.doctrine-project.org/projects/doctrine-orm/en/2.13/reference/basic-mapping.html#doctrine-mapping-types

ramsey commented 1 year ago

What change are you requesting for ramsey/uuid-doctrine?

zjbarg commented 1 year ago

@Legion112 string id column need not be UUID.