/** * Get the event * * @return \Zend\Mvc\MvcEvent * @throws Exception\DomainException if unable to find event */ private function getEvent() { if ($this->event) { return $this->event; } $controller = $this->getController(); if (!$controller instanceof \Zend\Mvc\InjectApplicationEventInterface) { throw new \Exception('Forward plugin requires a controller that implements InjectApplicationEventInterface'); } $event = $controller->getEvent(); if (!$event instanceof \Zend\Mvc\MvcEvent) { $params = []; if ($event) { $params = $event->getParams(); } $event = new MvcEvent(); $event->setParams($params); } $this->event = $event; return $this->event; }