protected function parseRequest(RequestInterface $request, MethodAbstract $method)
    {
        if ($method->hasRequest()) {
            $schema = $method->getRequest();
            if ($schema instanceof Passthru) {
                $data = $this->requestReader->getBody($request);
            } elseif ($schema instanceof SchemaInterface) {
                $data = $this->requestReader->getBodyAs($request, $method->getRequest(), $this->getValidator($method));
            } else {
                $data = new Record();
            }
        } else {
            $data = null;
        }

        return $data;
    }
protected function parseRequest(RequestInterface $request, MethodAbstract $method)
    {
        if ($method->hasRequest()) {
            $schema = $method->getRequest();
            if ($schema instanceof Passthru) {
                $data = $this->requestReader->getBody($request);
            } elseif ($schema instanceof SchemaInterface) {
                $data = $this->requestReader->getBodyAs($request, $method->getRequest(), $this->getValidator($method));
            } else {
                $data = new Record();
            }
        } else {
            $data = null;
        }

        return $data;
    }
protected function parseRequest ( RequestInterface $ request , MethodAbstract $ method ) { if ( $ method -> hasRequest ( ) ) { $ schema = $ method -> getRequest ( ) ; if ( $ schema instanceof Passthru ) { $ data = $ this -> requestReader -> getBody ( $ request ) ; } elseif ( $ schema instanceof SchemaInterface ) { $ data = $ this -> requestReader -> getBodyAs ( $ request , $ method -> getRequest ( ) , $ this -> getValidator ( $ method ) ) ; } else { $ data = new Record ( ) ; } } else { $ data = null ; } return $ data ; }
Imports the request data based on the schema if available

@param \PSX\Http\RequestInterface $request
@param \PSX\Api\Resource\MethodAbstract $method
@return \PSX\Record\RecordInterface
Imports the request data based on the schema if available