You are here

public function DocumentExtractor::getDocument in JSON:API Resources 8

Gets the document from the request.

Parameters

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

Return value

\Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel The document.

File

src/Unstable/DocumentExtractor.php, line 84

Class

DocumentExtractor
Document extractor for requests.

Namespace

Drupal\jsonapi_resources\Unstable

Code

public function getDocument(Request $request) {
  if (!$this->documents
    ->contains($request)) {
    $this->documents[$request] = $this
      ->extractDocument($request);
  }
  return $this->documents[$request];
}