示例#1
0
 public function beforeSave()
 {
     if ($this->hasAttribute('date') && !$this->date) {
         $this->date = new CDbExpression('NOW()');
     }
     return parent::beforeSave();
 }