|
|
@ -249,7 +249,7 @@ $component->detachBehaviors(); |
|
|
|
Using `TimestampBehavior` <a name="using-timestamp-behavior"></a> |
|
|
|
Using `TimestampBehavior` <a name="using-timestamp-behavior"></a> |
|
|
|
------------------------- |
|
|
|
------------------------- |
|
|
|
|
|
|
|
|
|
|
|
To wrap up, let's take a look at [[yii\behaviors\TimestampBehavior]]. This behavior supports automatically |
|
|
|
To wrap up, let's take a look at [[yii\behaviors\TimestampBehavior]]. This behavior supports automatically |
|
|
|
updating the timestamp attributes of an [[yii\db\ActiveRecord|Active Record]] model anytime the model is saved (e.g., on insert or update). |
|
|
|
updating the timestamp attributes of an [[yii\db\ActiveRecord|Active Record]] model anytime the model is saved (e.g., on insert or update). |
|
|
|
|
|
|
|
|
|
|
|
First, attach this behavior to the [[yii\db\ActiveRecord|Active Record]] class that you plan to use: |
|
|
|
First, attach this behavior to the [[yii\db\ActiveRecord|Active Record]] class that you plan to use: |
|
|
|