dispatch() public method

Dispatch a request
public dispatch ( Zend\Stdlib\RequestInterface $request, Zend\Stdlib\ResponseInterface $response = null ) : Zend\Stdlib\ResponseInterface | mixed
$request Zend\Stdlib\RequestInterface
$response Zend\Stdlib\ResponseInterface
return Zend\Stdlib\ResponseInterface | mixed
 public function dispatch(Request $request, Response $response = null)
 {
     if (!is_null($this->serviceLocator->get('di')->get('Frontend\\Service\\Instagram\\AuthenticationService')->getAuthData())) {
         return $this->redirect()->toRoute('frontend/gallery/configure');
     }
     return parent::dispatch($request, $response);
 }
 public function dispatch(ZendRequest $request, ZendResponse $response = null)
 {
     if (!$request instanceof HttpRequest) {
         throw new Exception\InvalidArgumentException('Expected an HTTP request');
     }
     $this->restRequest = $this->getServiceLocator()->get('BedRest.Request');
     return parent::dispatch($request, $response);
 }
 public function dispatch(Request $request, Response $response = null)
 {
     /* @var $authenticationService \Frontend\Service\Instagram\AuthenticationService */
     $authenticationService = $this->serviceLocator->get('di')->get('Frontend\\Service\\Instagram\\AuthenticationService');
     if (is_null($authenticationService->getAuthData())) {
         return $this->redirect()->toRoute('frontend');
     }
     $this->serviceLocator->get('di')->get('Frontend\\Service\\Instagram\\AuthorizationService')->authorize();
     return parent::dispatch($request, $response);
 }
 /**
  * Dispatch a request
  *
  * @events dispatch.pre, dispatch.post
  * @param  Request $request
  * @param  null|Response $response
  * @return Response|mixed
  */
 public function dispatch(Request $request, Response $response = null)
 {
     $this->resourceEntity = $this->getRepository()->findOneByToken($this->params()->fromRoute(static::REMOVE_ROUTE_PARAM));
     if (is_null($this->resourceEntity)) {
         $response = $response ?: new HttpResponse();
         $this->getEventManager()->clearListeners(MvcEvent::EVENT_DISPATCH);
         $response->setStatusCode(404);
     }
     parent::dispatch($request, $response);
 }
 /**
  * Dispatch a request
  *
  * @events dispatch.pre, dispatch.post
  * @param  Request $request
  * @param  null|Response $response
  * @return Response|mixed
  */
 public function dispatch(Request $request, Response $response = null)
 {
     $this->request = $request;
     $this->getDataResourceCreator()->setData(array_merge_recursive($this->params()->fromPost(), $request->getFiles()->toArray()));
     if (!$this->getDataResourceCreator()->isValid()) {
         if ($this->disableDefaultErrorHandler) {
             $response = $response ?: new HttpResponse();
             $this->getEventManager()->clearListeners(MvcEvent::EVENT_DISPATCH);
             $this->getEvent()->setResult(false);
             $response->setStatusCode(400);
         } else {
             $this->getEventManager()->clearListeners(MvcEvent::EVENT_DISPATCH);
             $this->uploaderModel->setMessages($this->getDataResourceCreator());
             $this->getEvent()->setResult($this->uploaderModel);
         }
     }
     parent::dispatch($request, $response);
 }
 /**
  * Dispatch a request
  *
  * If the route match includes an "action" key, then this acts basically like
  * a standard action controller. Otherwise, it introspects the HTTP method
  * to determine how to handle the request, and which method to delegate to.
  *
  * @events dispatch.pre, dispatch.post
  * @param  Request $request
  * @param  null|Response $response
  * @return mixed|Response
  * @throws Exception\InvalidArgumentException
  */
 public function dispatch(Request $request, Response $response = null)
 {
     if (!$request instanceof HttpRequest) {
         throw new Exception\InvalidArgumentException('Expected an HTTP request');
     }
     return parent::dispatch($request, $response);
 }