You are here

public function JsonapiHelper::__construct in Entity Share 8

Same name and namespace in other branches
  1. 8.3 modules/entity_share_client/src/Service/JsonapiHelper.php \Drupal\entity_share_client\Service\JsonapiHelper::__construct()
  2. 8.2 modules/entity_share_client/src/Service/JsonapiHelper.php \Drupal\entity_share_client\Service\JsonapiHelper::__construct()

JsonapiHelper constructor.

Parameters

\Symfony\Component\Serializer\SerializerInterface $serializer: A serializer.

\Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer $jsonapi_document_top_level_normalizer: The JsonApiDocumentTopLevelNormalizer normalizer.

\Drupal\jsonapi\ResourceType\ResourceTypeRepository $resource_type_repository: The resource type repository.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle info service.

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

\Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $entity_definition_update_manager: The entity definition update manager.

\Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager: The stream wrapper manager.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\entity_share_client\Service\RemoteManagerInterface $remote_manager: The remote manager service.

\Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher: The event dispatcher service.

File

modules/entity_share_client/src/Service/JsonapiHelper.php, line 156

Class

JsonapiHelper
Class JsonapiHelper.

Namespace

Drupal\entity_share_client\Service

Code

public function __construct(SerializerInterface $serializer, JsonApiDocumentTopLevelNormalizer $jsonapi_document_top_level_normalizer, ResourceTypeRepository $resource_type_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, EntityDefinitionUpdateManagerInterface $entity_definition_update_manager, StreamWrapperManagerInterface $stream_wrapper_manager, LanguageManagerInterface $language_manager, RemoteManagerInterface $remote_manager, EventDispatcherInterface $event_dispatcher) {
  $this->jsonapiDocumentTopLevelNormalizer = $jsonapi_document_top_level_normalizer;
  $this->jsonapiDocumentTopLevelNormalizer
    ->setSerializer($serializer);
  $this->resourceTypeRepository = $resource_type_repository;
  $this->bundleInfos = $entity_type_bundle_info
    ->getAllBundleInfo();
  $this->entityDefinitions = $entity_type_manager
    ->getDefinitions();
  $this->entityDefinitionUpdateManager = $entity_definition_update_manager;
  $this->entityTypeManager = $entity_type_manager;
  $this->streamWrapperManager = $stream_wrapper_manager;
  $this->languageManager = $language_manager;
  $this->remoteManager = $remote_manager;
  $this->eventDispatcher = $event_dispatcher;

  // TODO: Maybe use an API if the array is too big. State API, Tempstore or
  // Cache API.
  $this->importedEntities = [];
}