8000 [DoctrinBridge] make Uid types stricter by nicolas-grekas · Pull Request #38605 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DoctrinBridge] make Uid types stricter #38605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2020
Merged

Conversation

nicolas-grekas
Copy link
Member
Q A
Branch? 5.2
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Reviewing #38600 made me realize we don't need to deal with converting strings to db values.
We should only support converting actual AbstractUid instances in the DB.
Also, the binary types should not extend GuidType.

@stof
Copy link
Member
stof commented Oct 16, 2020

Also, the binary types should not extend GuidType.

IMO, none of them should, as they change the PHP format

@nicolas-grekas
Copy link
Member Author

IMO, none of them should, as they change the PHP format

Alright, updated. I also removed requiresSQLCommentHint() because I don't think comment-hints are required.

@nicolas-grekas nicolas-grekas force-pushed the db-uid branch 2 times, most recently from c7c4251 to 2d9c31d Compare October 16, 2020 16:47
@stof
Copy link
Member
stof commented Oct 16, 2020

I also removed requiresSQLCommentHint() because I don't think comment-hints are required.

they are required, because the type does not register a mapping type, so schema introspection would not recognize them without the special comment

@nicolas-grekas
Copy link
Member Author

Thanks, reverted this part :)

@fabpot
Copy link
Member
fabpot commented Oct 17, 2020

Thank you @nicolas-grekas.

@fabpot fabpot merged commit fdf9a43 into symfony:5.x Oct 17, 2020
@nicolas-grekas
Copy link
Member Author

(Partially reverted in #38986)

fabpot added a commit that referenced this pull request Nov 5, 2020
…lues (nicolas-grekas)

This PR was merged into the 5.2-dev branch.

Discussion
----------

[DoctrineBridge] accept converting Uid-as-strings to db-values

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38929
| License       | MIT
| Doc PR        | -

In #38605 I made Uid types stricter by taking inspiration from native Doctrine types. But #38929 (comment) made me realize this doesn't work with ParamConverters. Here is the fix.

Commits
-------

20714d6 [DoctrineBridge] accept converting Uid-as-strings to db-values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0