コード例 #1
0
 protected function findModel($code)
 {
     if ($code == 'init') {
         $model = new InitWizard();
     } else {
         $model = new BasicProcess();
     }
     $model->init();
     return $model;
 }
コード例 #2
0
ファイル: InitWizard.php プロジェクト: ianikanov/homefinance
 public function performStep($step)
 {
     if (parent::performStep($step)) {
         // ...custom code here...
         if ($step->code == 'init1') {
             //init two months on the first step
             $model = new BalanceSheet();
             $model->prepareNext();
             if ($model->save()) {
                 $model->initAmounts();
             }
             $model = new BalanceSheet();
             $model->prepareNext();
             if ($model->save()) {
                 $model->initAmounts();
             }
         }
         return $this->createBalanceItem($step);
     } else {
         return false;
     }
 }