behaviors/JsonAttributeBehavior.php
public function beforeSave($event)
    {
        foreach ($this->attributes as $name) {
            if (!empty($this->owner->$name)) {
                $this->owner->$name = $this->jsonEncodeAttribute($name);
            } else {
                $this->owner->$name = null;
            }
        }
    }
public function beforeSave($event)
    {
        foreach ($this->attributes as $name) {
            if (!empty($this->owner->$name)) {
                $this->owner->$name = $this->jsonEncodeAttribute($name);
            } else {
                $this->owner->$name = null;
            }
        }
    }
Actions to take before saving the owner of this behavior.
@param CModelEvent $event event parameter.