-
Notifications
You must be signed in to change notification settings - Fork 398
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
fix timestampable use of datetimeclass #2017
base: master
Are you sure you want to change the base?
Conversation
@dereuromark based on other PR's it seems the CI errors where not introduced here. I think it is better to address at them in a separate PR, no? What do you think about this change? |
@gechetspr it seems you are my best bet to ping :) Thank you! This PR would enable the timestampable behaviour to use The CI failures are the same as on all other recent PRs (see comment on #2015). I'm not sure what's happening with mysql, but I will try to have a look at the code-style error. |
939581e
to
ed0a54d
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.
Do we have tests for src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php ? mb we should update those too to make sure that all works as expected?
src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php
Outdated
Show resolved
Hide resolved
I've resolved your remarks. Good suggestions! |
@gechetspr it looks ok now I think. |
The timestampable behavior doesn't use the
generator.dateTime.dateTimeClass
setting.I took a few liberties adressing this:
Propel\Generator\Builder\Om\ObjectBuilder
. For this it had to becomepublic
.PropelDateTime::createHighPrecision
expects the output ofmicrotime
to be formatted with a dot. This places the formatting in a separate (static) method.This allows keeping the updated_at and created_at microtimes in preInsert exactly the same value (instead of generating them independently).
I've avoided simplifying code to not break things.
What do you think?