You are here

protected function DocumentExtractor::extractDocument in JSON:API Resources 8

Extracts the JSON:API document from a request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request.

Return value

\Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel The document.

1 call to DocumentExtractor::extractDocument()
DocumentExtractor::getDocument in src/Unstable/DocumentExtractor.php
Gets the document from the request.

File

src/Unstable/DocumentExtractor.php, line 101

Class

DocumentExtractor
Document extractor for requests.

Namespace

Drupal\jsonapi_resources\Unstable

Code

protected function extractDocument(Request $request) {
  return new JsonApiDocumentTopLevel(new ResourceObjectData([
    $this
      ->extractResourceObjectFromRequest($request),
  ], 1), new NullIncludedData(), new LinkCollection([]));
}