Commit fed61f7d by Alexander Kochetov

Advanced app `User` model code style fixes

parent 044fe363
...@@ -3,6 +3,7 @@ namespace common\models; ...@@ -3,6 +3,7 @@ namespace common\models;
use Yii; use Yii;
use yii\base\NotSupportedException; use yii\base\NotSupportedException;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord; use yii\db\ActiveRecord;
use yii\web\IdentityInterface; use yii\web\IdentityInterface;
...@@ -41,13 +42,7 @@ class User extends ActiveRecord implements IdentityInterface ...@@ -41,13 +42,7 @@ class User extends ActiveRecord implements IdentityInterface
public function behaviors() public function behaviors()
{ {
return [ return [
'timestamp' => [ TimestampBehavior::className(),
'class' => 'yii\behaviors\TimestampBehavior',
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
],
],
]; ];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment