-
Notifications
You must be signed in to change notification settings - Fork 2
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
Support for nullable enums #19
Comments
You can register Platenum embeddables manually, <embeddable name="FQCN">
<field name="value" type="smallint" column="value" nullable="false" />
</embeddable> I see your point though, so let's move the discussion to #20. |
Leaving these notes for future readers:
|
Thanks for related issues. "Problem" with embeddables is that they use prefixes (class-field) and requires more configuration than simple field with custom type, so I wanted to use custom types. On the side note - I found it hard yesterday to find correct place in Symfony app to call
|
@Wirone I used them both ways (embeddable and custom type) in different projects, I guess it's a matter of personal taste and team approach. Custom types definitely feel cleaner and "better isolated" especially when you apply Hexagonal architecture as I see from your code example. :) As for the place for their registration, though, it depends on your overall approach:
Side note: In Doctrine 3.0 the global |
PlatenumDoctrineType
does not support nullable fields. When entity which uses enums on nullable fields is persisted, there isCall to a member function getValue() on null
error. Unfortunately since class isfinal
it's impossible to overrideconvertToDatabaseValue()
andconvertToPHPValue()
methods.The text was updated successfully, but these errors were encountered: