-
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
#1447. On preInsert object in TimestampableBehavior we get different… #1457
Conversation
/** | ||
* Get a DateTime object with milliseconds resolution. | ||
* | ||
* @param null $time |
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.
whats the alternative value? should be stated here, too.
Yeah, tests passed |
@@ -85,7 +85,7 @@ public function preUpdate($builder) | |||
if ($this->withUpdatedAt()) { | |||
$valueSource = strtoupper($this->getTable()->getColumn($this->getParameter('update_column'))->getType()) === 'INTEGER' | |||
? 'time()' | |||
: '\\Propel\\Runtime\\Util\\PropelDateTime::createHighPrecision()' | |||
: '\\Propel\\Runtime\\Util\\PropelDateTime::createSameHighPrecision(1)' |
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.
createSameHighPrecision has as first argument a bool, not a integer.
Can you talk a bit about that solution and why you've chosen to use a static global stored timestamp in the PropelDateTime class? I don't think that is very elegant, maybe you can show me what the actual error is so we can find a more sexy solution. |
? 'time()' | ||
: '\\Propel\\Runtime\\Util\\PropelDateTime::createHighPrecision()' | ||
: '\\Propel\\Runtime\\Util\\PropelDateTime::createSameHighPrecision(1)' |
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.
same here
Hi @marcj Other solution - is change generated script with additional conditions for check if created date is exist and update exist - generate once time. If you have any idea how I can do it for easy understand and without static - I will be try do it. I will be change number to boolean. |
@marcj I set boolean type instead integer. |
@marcj I have found solution without using static variable. |
… dataTime. For solve this situation we need available set same time on create and update field.
That looks way better, thanks! |
… dataTime.
For solve this situation we need available set same time on create and update field.