Is there an event afterSet for model?

Hi I’m trying to do a few calculations on the attributes of the model after the properties have been chunk assigned (safe).




$model->attributes = $_POST['MyModel'];


I'd like to have something like:

public function afterSet(){

    ... my code

}

I’m purposefully don’t want to use beforeSave().

Maybe you could use a filter in your rules() method

http://www.yiiframework.com/wiki/56/#hh13

It executes only on validate();

So you need to create your method and call after set. Or ovverride setAttributes method and add afterSetAttributes callback.

@SiZE

I really like your idea. Thanks! :)