Changes
Title
unchanged
Understanding Scenarios
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
Form validation, Scenarios, validation rules, model validation, understanding
Content
changed
[...]
------------------
CActiveRecord sets a number of scenarios internally, any rules you set are validated against these scenarios depending on what operation is performed.
#### 1. Insert
All instances of CActiveRecord instantiated via the constructor with the _new_ keyword are set to this scenario by default. Any rules with the scenario will only be validated on database insert (first call to the save() method).
#### 2. Update
All instances of CActiveRecord instantiated via the find() methods are set to this scenario by default. Any rules with the scenario will only be validated on database updates (subsequent calls to the save() method).
#### 3. Search[...]