/** * @return HttpResponse|null */ protected function completeWizard() { $wizardEvent = new WizardEvent(); $wizardEvent->setWizard($this->wizard); $wizardEventManager = $this->wizard->getEventManager(); $wizardEventManager->trigger(WizardEvent::EVENT_COMPLETE, $wizardEvent); return $this->doRedirect(); }
/** * @param ServiceLocatorInterface $serviceLocator * @return Wizard */ public function createService(ServiceLocatorInterface $serviceLocator) { /* @var $wizard \Wizard\WizardInterface */ $wizard = new Wizard(); $formFactory = $serviceLocator->get('Wizard\\Form\\FormFactory'); $wizard->setFormFactory($formFactory); $wizardProcessor = $serviceLocator->get('Wizard\\WizardProcessor'); $wizard->setWizardProcessor($wizardProcessor); $identifierAccessor = $serviceLocator->get('Wizard\\Wizard\\IdentifierAccessor'); $wizard->setIdentifierAccessor($identifierAccessor); $wizardListener = $serviceLocator->get('Wizard\\Listener\\WizardListener'); $wizard->getEventManager()->attachAggregate($wizardListener); $stepCollection = $wizard->getSteps(); $stepCollectionListener = $serviceLocator->get('Wizard\\Listener\\StepCollectionListener'); $stepCollection->getEventManager()->attachAggregate($stepCollectionListener); return $wizard; }