Neos\Flow\Mvc\Controller\AbstractController::initializeController PHP Method

initializeController() protected method

This method should be called by the concrete processRequest() method.
protected initializeController ( Neos\Flow\Mvc\RequestInterface $request, Neos\Flow\Mvc\ResponseInterface $response )
$request Neos\Flow\Mvc\RequestInterface
$response Neos\Flow\Mvc\ResponseInterface
    protected function initializeController(RequestInterface $request, ResponseInterface $response)
    {
        if (!$request instanceof ActionRequest) {
            throw new UnsupportedRequestTypeException(get_class($this) . ' only supports action requests – requests of type "' . get_class($request) . '" given.', 1187701131);
        }
        $this->request = $request;
        $this->request->setDispatched(true);
        $this->response = $response;
        $this->uriBuilder = new UriBuilder();
        $this->uriBuilder->setRequest($this->request);
        $this->arguments = new Arguments([]);
        $this->controllerContext = new ControllerContext($this->request, $this->response, $this->arguments, $this->uriBuilder);
        $mediaType = $request->getHttpRequest()->getNegotiatedMediaType($this->supportedMediaTypes);
        if ($mediaType === null) {
            $this->throwStatus(406);
        }
        if ($request->getFormat() === null) {
            $this->request->setFormat(MediaTypes::getFilenameExtensionFromMediaType($mediaType));
        }
    }