protected function getContentResponse(
        $data,
        $statusCode = Response::HTTP_OK,
        $links = null,
        $meta = null
    ) {
        $parameters      = $this->getParameters();
        $encoder         = $this->codecMatcher->getEncoder();
        $outputMediaType = $this->codecMatcher->getEncoderRegisteredMatchedType();

        $links === null ?: $encoder->withLinks($links);
        $meta  === null ?: $encoder->withMeta($meta);

        /** @var ResponsesInterface $responses */
        $responses = $this->getIntegration()->getFromContainer(ResponsesInterface::class);
        $content   = $encoder->encodeData($data, $parameters);

        return $responses->getResponse($statusCode, $outputMediaType, $content, $this->supportedExtensions);
    }
protected function getContentResponse(
        $data,
        $statusCode = Response::HTTP_OK,
        $links = null,
        $meta = null
    ) {
        $parameters      = $this->getParameters();
        $encoder         = $this->codecMatcher->getEncoder();
        $outputMediaType = $this->codecMatcher->getEncoderRegisteredMatchedType();

        $links === null ?: $encoder->withLinks($links);
        $meta  === null ?: $encoder->withMeta($meta);

        /** @var ResponsesInterface $responses */
        $responses = $this->getIntegration()->getFromContainer(ResponsesInterface::class);
        $content   = $encoder->encodeData($data, $parameters);

        return $responses->getResponse($statusCode, $outputMediaType, $content, $this->supportedExtensions);
    }
protected function getContentResponse ( $ data , $ statusCode = Response :: HTTP_OK , $ links = null , $ meta = null ) { $ parameters = $ this -> getParameters ( ) ; $ encoder = $ this -> codecMatcher -> getEncoder ( ) ; $ outputMediaType = $ this -> codecMatcher -> getEncoderRegisteredMatchedType ( ) ; $ links === null ? : $ encoder -> withLinks ( $ links ) ; $ meta === null ? : $ encoder -> withMeta ( $ meta ) ; /** @var ResponsesInterface $responses */ $ responses = $ this -> getIntegration ( ) -> getFromContainer ( ResponsesInterface :: class ) ; $ content = $ encoder -> encodeData ( $ data , $ parameters ) ; return $ responses -> getResponse ( $ statusCode , $ outputMediaType , $ content , $ this -> supportedExtensions ) ; }
Get response with regular JSON API Document in body.

@param object|array                                                       $data
@param int                                                                $statusCode
@param array<string,\Neomerx\JsonApi\Contracts\Schema\LinkInterface>|null $links
@param mixed                                                              $meta

@return Response
Get response with regular JSON API Document in body .