Created
November 2, 2014 00:54
-
-
Save evercode1/ecc2f5b14577d109815b 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 [ | |
'timestamp' => [ | |
'class' => 'yii\behaviors\TimestampBehavior', | |
'attributes' => [ | |
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], | |
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'], | |
], | |
'value' => new Expression('NOW()'), | |
], | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment