Ejemplo n.º 1
0
 /**
  * Redirect to step display action.
  *
  * @param ProcessInterface $process
  * @param StepInterface    $step
  * @param ParameterBag     $queryParameters
  *
  * @return RedirectResponse
  */
 protected function redirectToStepDisplayAction(ProcessInterface $process, StepInterface $step, ParameterBag $queryParameters = null)
 {
     $this->context->addStepToHistory($step->getName());
     if (null !== ($route = $process->getDisplayRoute())) {
         $url = $this->router->generate($route, array_merge($process->getDisplayRouteParams(), array('stepName' => $step->getName()), $queryParameters ? $queryParameters->all() : array()));
         return new RedirectResponse($url);
     }
     // Default parameters for display route
     $routeParameters = array('scenarioAlias' => $process->getScenarioAlias(), 'stepName' => $step->getName());
     if (null !== $queryParameters) {
         $routeParameters = array_merge($queryParameters->all(), $routeParameters);
     }
     return new RedirectResponse($this->router->generate('sylius_flow_display', $routeParameters));
 }