public function beforeSave()
{
if (in_array(Yii::app()->getController()->getAction()->id, array('create', 'update'))) {
if (!$this->draft) {
$this->print = 1;
$this->print_all = 1;
}
}
foreach (array('address', 'introduction', 're', 'body', 'footer', 'cc') as $field) {
$this->{$field} = trim($this->{$field});
}
if (!$this->clinic_date) {
$this->clinic_date = null;
}
return parent::beforeSave();
}