Example #1
0
 public function save()
 {
     if (!$this->validate()) {
         return false;
     }
     if (!($info = Monc::app()->user->getState('info'))) {
         throw new RuntimeException('第二步的个人信息还没填写');
     }
     $model = new Request();
     $model->setAttributes($info);
     $model->setAttributes($this->getAttributes());
     if (!$model->save()) {
         $this->addErrors($model->getErrors());
         return false;
     }
     return true;
 }