Scenario and find or findAll

Hi

by default CActiveRecord::find and findAll set scenario to update

i can set other scenario?

[color=#333333][font=arial, sans-serif][size=6]or I have to do this[/size][/font][/color]




....


            $models=IngresoDetalles::model()->findAll('idIngreso='.$idIngreso);

            foreach ($models as $k => $det) {

                    $det->setScenario('verifica');

                    $models[$k]=$det;

                }

....



thanks

Yes, you can use behavior like:


class OtherScenario extends CBehavior {

public function afterFind()

{

$this->getOwner()->setScenario('my_scenario');

}

}

or you can inherit your model from MyScenarioAR, where MyScenarioAr like this:




public function afterFind()

{

$this->setScenario('my_scenario');

}



Thanks you