protected function findModel($code)
 {
     if ($code == 'init') {
         $model = new InitWizard();
     } else {
         $model = new BasicProcess();
     }
     $model->init();
     return $model;
 }
Exemple #2
0
 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;
     }
 }