Skip to content
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

💡 Allow setting enum cases as property defaults #477

Open
rauanmayemir opened this issue Apr 20, 2024 · 0 comments
Open

💡 Allow setting enum cases as property defaults #477

rauanmayemir opened this issue Apr 20, 2024 · 0 comments
Labels
type:feature New feature.

Comments

@rauanmayemir
Copy link
Contributor

I have an idea!

Currently, entity column attribute declaration can look like this:

new Cycle\Column(type: 'tinyInteger', property: 'event_type', default: EventType::CREATED->value, typecast: EventType::class),

I.e we can only use scalar values like EventType::CREATED->value as default.

Proposed improvement suggestion is to allow using enum cases without converting to underlying scalar value like so:

new Cycle\Column(type: 'tinyInteger', property: 'event_type', default: EventType::CREATED, typecast: EventType::class),
@rauanmayemir rauanmayemir added the type:feature New feature. label Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature.
Projects
Status: Todo
Development

No branches or pull requests

1 participant