-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(AppFramework): Add full support for date / time / datetime columns #47329
Conversation
2346049
to
2d9b552
Compare
The next major (which we will have to update to soon) changed behaviour of DateTime: https://github.com/doctrine/dbal/blob/4.1.x/UPGRADE.md#bc-break-stricter-datetime-types |
@nickvergessen this is what I implemented already, whats breaking is that |
e62ee82
to
c059051
Compare
|
478135b
to
87fb634
Compare
3046e20
to
a236626
Compare
a236626
to
45e799b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
$this->addType('id', 'int'); | ||
$this->addType('tokenId', 'int'); | ||
$this->addType('clientId', 'int'); | ||
$this->addType('id', Types::INTEGER); | ||
$this->addType('tokenId', Types::INTEGER); | ||
$this->addType('clientId', Types::INTEGER); | ||
$this->addType('hashedCode', 'string'); | ||
$this->addType('encryptedToken', 'string'); | ||
$this->addType('codeCreatedAt', 'int'); | ||
$this->addType('tokenCount', 'int'); | ||
$this->addType('codeCreatedAt', Types::INTEGER); | ||
$this->addType('tokenCount', Types::INTEGER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone should write a Rector rule for this
This adds support for all Doctrine supported types, for the column types only the immutable variants needed to be added. But especially those types are the important ones, as our **Entity** class works by detecting changes through setters. Meaning if it is mutable, changes like `$entity->date->modfiy()` can not be detected, so the immutable types make more sense here. Similar the parameter types needed to be added. `Enity` and `QBMapper` needed to be adjusted so they support (auto map) those types, required when insert or update an entity. Also added more tests, especially to make sure the mapper really serializes the values correctly. Co-authored-by: Ferdinand Thiessen <[email protected]> Co-authored-by: Côme Chilliet <[email protected]> Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
45e799b
to
0e54c2b
Compare
Summary
This adds support for all Doctrine supported types, for the column types only the immutable variants needed to be added. But especially those types are the important ones, as our Entity class works by detecting changes through setters. Meaning if it is mutable, changes like
$entity->date->modfiy()
can not be detected, so the immutable types make more sense here.Similar the parameter types needed to be added.
Enity
andQBMapper
needed to be adjusted so they support (auto map) those types, required when insert or update an entity.Also added more tests, especially to make sure the mapper really serializes the values correctly.
Checklist