コード例 #1
0
ファイル: Coordinator.php プロジェクト: benakacha/Sylius
 /**
  * @param ProcessInterface $process
  * @param string           $scenarioAlias
  *
  * @return RedirectResponse
  */
 protected function goToLastValidStep(ProcessInterface $process, $scenarioAlias)
 {
     //the step we are supposed to display was not found in the history.
     if (null === $this->context->getPreviousStep()) {
         //there is no previous step go to start
         return $this->start($scenarioAlias);
     }
     //we will go back to previous step...
     $history = $this->context->getStepHistory();
     if (empty($history)) {
         //there is no history
         return $this->start($scenarioAlias);
     }
     $step = $process->getStepByName(end($history));
     $this->context->initialize($process, $step);
     return $this->redirectToStepDisplayAction($process, $step);
 }
コード例 #2
0
ファイル: ProcessContext.php プロジェクト: lingoda/Sylius
 /**
  * {@inheritdoc}
  */
 public function setNextStepByName($stepName)
 {
     $this->nextStep = $this->process->getStepByName($stepName);
 }