Array property of active record

I am having problems in one of my models where I want a property storing an array. This array should be converted to a string when storing to database, and when loading it back to model it should be converted from string to array.

Is this matter dealt with in Yii 1.1, or is there any plugin/behaviour that deals with it?

I am completely stuck now!

//Before Save to DB
json_encode($arr) //converts an array to JSON string

//Before usage from DB
json_decode($arr) //converts json string to php array