我不知道这个函数会返回什么,只是修改了记录属性还是其他什么?
protected function beforeSave()
{
if ($this->getIsNewRecord())
{
$this->created = Yii::app()->localtime->UTCNow;
}
$this->lastmodified = Yii::app()->localtime->UTCNow;
if ($this->dob == '') {
$this->setAttribute('dob', null);
} else {
$this->dob=date('Y-m-d', strtotime($this->dob));
}
if($this->image!="")
{
$this->imgfile_name = $this->image->name;
$this->imgfile_type = $this->image->type;
$this->imgfile_size = $this->image->size;
}
$this->phone=substr($this->phone,0,3).substr($this->phone,4,3).substr($this->phone,8,4);
return parent::beforeSave();
}