-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use DBAL Type for Field type #727
Merged
Merged
Conversation
This file contains 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
ca9b29a
to
c9bfedb
Compare
This was referenced Sep 18, 2020
76e1d85
to
70d34fd
Compare
e7d603c
to
a4b0d85
Compare
7fcf3bc
to
181d4ec
Compare
31b600d
to
7cd48e5
Compare
53b09c3
to
cc0d0e6
Compare
7cd48e5
to
9a9e6f1
Compare
cc0d0e6
to
524dc9c
Compare
9a9e6f1
to
87be248
Compare
mvorisek
commented
Oct 13, 2020
2 tasks
524dc9c
to
50a0f79
Compare
87be248
to
8bfebca
Compare
50a0f79
to
9aca684
Compare
6e9306c
to
224ea0b
Compare
fb81465
to
468dabe
Compare
288339e
to
7c2ed40
Compare
10065e5
to
57007eb
Compare
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.
If a custom typecasting is needed, easy, simply register own type in DBAL. If a library wants to provide some custom types by default, bootstrap (register on load time) using composer.
I think this is step in a good direction, as we can then leave all typecasting to standard DBAL Types and remove all hacky typing from the code. DBAL Types can also be easily replaced and/or a new/custom Type can be easily added.
BC breaks:
Field::serialize
property, to use PHP serialization, useobject
type.Field::typecast
property, to use a custom typecasting, extend the target DBAL type class and register it or implement a custom persistenceField::dateTimeClass/dateTimeZoneClass
properties, see bullet point aboveremovedField::persist_format/persist_timezone
properties, see above, but you probably want to handle it using persistence/UI solely - if there was a shared format/TZ, different format/TZ was not possible to set for the database and UIModel::strict_types
property, was already enabled by default, normalization can still be disabled/broken byModel::HOOK_NORMALIZE
hookarray
type is temporary forbidden to be used,object
type now serializes data using PHP serialization, to use JSON, usejson
type. For more details, see the following table:array
json
array
type now behaves differently, thus temporary forbidden to be used in atk4/dataobject
json
Field::serialize
flag was neededobject
Field::serialize
flag was neededarray
object
type instead