voskobovich/yii2-many-to-many-behavior

created_at and updated at

zmoddynamics opened this issue · 4 comments

Hi, Thank you for creating this very useful extension. I have a minor issue which isn't a huge deal for my application but was hoping for your thoughts. Following your guidance, I am using the viaTableValues as shown below:

'relations' => [ 'variable_ids' => [ 'variables', 'viaTableValues' => [ 'created_at' => function($model, $relationName, $attributeName, $relatedPk) { return $model->isNewRecord ? time(): $model->created_at; }, 'updated_at' => function() { return time(); }, ], ] ],

Upon record creation, the updated_at and created_at times are slightly different. Any suggestions? I also notice, that even if I do not change the attribute value for say variable_id, the updated_at time changes ?

Yes, I know about this problem. In developing the second version which doesn't pass the tests and cannot be released. There is a desire, see branch "linker". I will be glad for your help.

Thanks. I will probably also create a pull request for another feature to be added as well. I’ll see if I can help you as I would like the default behavior of TimeStamp within the extension.

From: Vitaly Voskobovich notifications@github.com
Reply-To: voskobovich/yii2-many-to-many-behavior reply@reply.github.com
Date: Tuesday, August 16, 2016 at 4:37 PM
To: voskobovich/yii2-many-to-many-behavior yii2-many-to-many-behavior@noreply.github.com
Cc: Clint Zeringue2 clint.zeringue@zmoddynamics.com, Author author@noreply.github.com
Subject: Re: [voskobovich/yii2-many-to-many-behavior] created_at and updated at (#46)

Yes, I know about this problem. In developing the second version which doesn't pass the tests and cannot be released. There is a desire, see branch "linker". I will be glad for your help.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/46#issuecomment-240247319, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AA61pWZ1YKXZncKZB2R2BIMH5tzCRmjVks5qgi2EgaJpZM4JjiS1.

Hi! Released the new version of behavior. It's already available for use on the link Yii2 Linker Behavior.

The new version solved your problem.