You are here

public function CurrentUserInfo::__construct in JSON:API Resources 8

Constructs a new EntityResourceBase object.

Parameters

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

\Drupal\Core\Session\AccountInterface $account: The current user.

\Drupal\Core\Access\CsrfTokenGenerator $token_generator: The CSRF token generator.

File

tests/modules/jsonapi_resources_test/src/Resource/CurrentUserInfo.php, line 60

Class

CurrentUserInfo
Processes a request for the authenticated user's information.

Namespace

Drupal\jsonapi_resources_test\Resource

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, AccountInterface $account, CsrfTokenGenerator $token_generator) {
  $this->entityTypeManager = $entity_type_manager;
  $this->currentUser = $account;
  $this->tokenGenerator = $token_generator;
}