You are here

protected function RequestHandler::resourceFactory in JSON:API 8

Get the resource.

Parameters

\Drupal\jsonapi\ResourceType\ResourceType $resource_type: The JSON API resource type for the current request.

Return value

\Drupal\jsonapi\Controller\EntityResource The instantiated resource.

1 call to RequestHandler::resourceFactory()
RequestHandler::handle in src/Controller/RequestHandler.php
Handles a JSON API request.

File

src/Controller/RequestHandler.php, line 246

Class

RequestHandler
Acts as request forwarder for \Drupal\jsonapi\Controller\EntityResource.

Namespace

Drupal\jsonapi\Controller

Code

protected function resourceFactory(ResourceType $resource_type) {
  $resource = new EntityResource($resource_type, $this->entityTypeManager, $this->fieldManager, $this->fieldTypeManager, $this->linkManager, $this->resourceTypeRepository, $this->renderer);
  return $resource;
}