@@ 94-110 (lines=17) @@ | ||
91 | /** |
|
92 | * @inheritdoc |
|
93 | */ |
|
94 | public function behaviors() |
|
95 | { |
|
96 | return [ |
|
97 | 'blameable' => [ |
|
98 | 'class' => BlameableBehavior::className(), |
|
99 | 'createdByAttribute' => 'created_by', |
|
100 | 'updatedByAttribute' => 'updated_by', |
|
101 | ], |
|
102 | 'timestamp' => [ |
|
103 | 'class' => TimestampBehavior::className(), |
|
104 | 'attributes' => [ |
|
105 | ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], |
|
106 | ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'], |
|
107 | ] |
|
108 | ] |
|
109 | ]; |
|
110 | } |
|
111 | ||
112 | /** |
|
113 | * @inheritdoc |
@@ 57-73 (lines=17) @@ | ||
54 | /** |
|
55 | * @inheritdoc |
|
56 | */ |
|
57 | public function behaviors() |
|
58 | { |
|
59 | return [ |
|
60 | 'blameable' => [ |
|
61 | 'class' => BlameableBehavior::className(), |
|
62 | 'createdByAttribute' => 'created_by', |
|
63 | 'updatedByAttribute' => 'updated_by', |
|
64 | ], |
|
65 | 'timestamp' => [ |
|
66 | 'class' => TimestampBehavior::className(), |
|
67 | 'attributes' => [ |
|
68 | ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], |
|
69 | ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'], |
|
70 | ] |
|
71 | ] |
|
72 | ]; |
|
73 | } |
|
74 | ||
75 | /** |
|
76 | * @inheritdoc |