interception of data that we get from the database

The problem is quite original, I will not go into details.

I need to pass through the method of any value that comes from the database to format them to clean up, etc. does not matter.

Actually, how? Thank you.

for example if you had a model called Event… in the model you’d create an afterFind function…

public function afterFind()

{

        $this->event_start_date=DateTime::createFromFormat('d-m-Y',$this->event_start_date);


        //would take the date from the db and format it for yii to use


        parent::afterFind();


        return true;

}

yes, its good idea, thank you :) but i want something on CDbCommand level… for intercepting direct queries.