Created
July 6, 2017 12:18
-
-
Save thyseus/9a634096790c4d672a9fa6dd65779a18 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public function behaviors() | |
| { | |
| return [ | |
| [ | |
| 'class' => TimestampBehavior::className(), | |
| 'attributes' => [ | |
| ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], | |
| ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'], | |
| ], | |
| // if you're using datetime instead of UNIX timestamp: | |
| // 'value' => new Expression('NOW()'), | |
| ], | |
| ]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.