Yii implicitly calls $user->setScenario() whenever you try to write to its scenario property. This works for properties with any name. For example, in your User model:
private $someProperty;
public function setSomeProperty($value) {
$this->somePropery = $value;
// maybe do something else here too
}
Now if you try to set someProperty like this:
$user->someProperty = 'test';
The above function will be called by Yii.
Same thing for reading a property, Yii will implicitly call $user->getScenario(), $user->getSomeProperty(), or something similar, whenever this method exists.