You are here

public function EntityResource::__construct in JSON:API 8

Same name and namespace in other branches
  1. 8.2 src/Controller/EntityResource.php \Drupal\jsonapi\Controller\EntityResource::__construct()

Instantiates a EntityResource object.

Parameters

\Drupal\jsonapi\ResourceType\ResourceType $resource_type: The JSON API resource type.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Entity\EntityFieldManagerInterface $field_manager: The entity type field manager.

\Drupal\Core\Field\FieldTypePluginManagerInterface $plugin_manager: The plugin manager for fields.

\Drupal\jsonapi\LinkManager\LinkManager $link_manager: The link manager service.

\Drupal\jsonapi\ResourceType\ResourceTypeRepositoryInterface $resource_type_repository: The link manager service.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

File

src/Controller/EntityResource.php, line 116

Class

EntityResource
Process all entity requests.

Namespace

Drupal\jsonapi\Controller

Code

public function __construct(ResourceType $resource_type, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $field_manager, FieldTypePluginManagerInterface $plugin_manager, LinkManager $link_manager, ResourceTypeRepositoryInterface $resource_type_repository, RendererInterface $renderer) {
  $this->resourceType = $resource_type;
  $this->entityTypeManager = $entity_type_manager;
  $this->fieldManager = $field_manager;
  $this->pluginManager = $plugin_manager;
  $this->linkManager = $link_manager;
  $this->resourceTypeRepository = $resource_type_repository;
  $this->renderer = $renderer;
}