feat(orm): Add support for BackedEnum in Entity column - #63292
Open
CarlSchwan wants to merge 1 commit into
Open
Conversation
CarlSchwan
requested review from
Altahrim,
come-nc,
icewind1991 and
leftybournes
and removed request for
a team
August 15, 2026 11:24
CarlSchwan
force-pushed
the
carl/enum-entity
branch
from
August 15, 2026 11:26
316dc12 to
94f7fa3
Compare
come-nc
reviewed
Aug 17, 2026
Comment on lines
+114
to
+117
| if (!is_string($value) && !is_int($value)) { | ||
| throw new \LogicException("Can only convert int and string to enum"); | ||
| } | ||
| $value = $enumType::from($value); |
Contributor
There was a problem hiding this comment.
Why the manual test? Just use ::from and it will throw a ValueError if the type is not supported.
Member
Author
There was a problem hiding this comment.
And now I remember why I added it. to make psalm strict happy
CarlSchwan
force-pushed
the
carl/enum-entity
branch
from
August 17, 2026 19:03
94f7fa3 to
e38be4d
Compare
Convert from and to the value in the database Assisted-by: ClaudeCode:claude-opus-5 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
CarlSchwan
force-pushed
the
carl/enum-entity
branch
from
August 17, 2026 20:41
e38be4d to
c7df646
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Convert from and to the value in the database
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)