You are here

public function EntityResource::__construct in Drupal 10

Same name in this branch
  1. 10 core/modules/jsonapi/src/Controller/EntityResource.php \Drupal\jsonapi\Controller\EntityResource::__construct()
  2. 10 core/modules/rest/src/Plugin/rest/resource/EntityResource.php \Drupal\rest\Plugin\rest\resource\EntityResource::__construct()
Same name and namespace in other branches
  1. 8 core/modules/rest/src/Plugin/rest/resource/EntityResource.php \Drupal\rest\Plugin\rest\resource\EntityResource::__construct()
  2. 9 core/modules/rest/src/Plugin/rest/resource/EntityResource.php \Drupal\rest\Plugin\rest\resource\EntityResource::__construct()

Constructs a Drupal\rest\Plugin\rest\resource\EntityResource object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

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

array $serializer_formats: The available serialization formats.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Component\Plugin\PluginManagerInterface $link_relation_type_manager: The link relation type manager.

Overrides ResourceBase::__construct

File

core/modules/rest/src/Plugin/rest/resource/EntityResource.php, line 90

Class

EntityResource
Represents entities as resources.

Namespace

Drupal\rest\Plugin\rest\resource

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, $serializer_formats, LoggerInterface $logger, ConfigFactoryInterface $config_factory, PluginManagerInterface $link_relation_type_manager) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger);
  $this->entityType = $entity_type_manager
    ->getDefinition($plugin_definition['entity_type']);
  $this->configFactory = $config_factory;
  $this->linkRelationTypeManager = $link_relation_type_manager;
}