You are here

public function PrivateMessageThreadMessageFormatter::__construct in Private Message 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/PrivateMessageThreadMessageFormatter.php \Drupal\private_message\Plugin\Field\FieldFormatter\PrivateMessageThreadMessageFormatter::__construct()

Construct a PrivateMessageThreadFormatter object.

Parameters

string $plugin_id: The ID of the plugin.

mixed $plugin_definition: The plugin definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition.

array $settings: The field settings.

mixed $label: The label of the field.

string $view_mode: The current view mode.

array $third_party_settings: The third party settings.

\Drupal\Core\Entity\EntityManagerInterface $entityManager: The entity manager service.

|Drupal\Core\Session\AccountProxyInterface $currentUser: The current user.

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

Overrides FormatterBase::__construct

File

src/Plugin/Field/FieldFormatter/PrivateMessageThreadMessageFormatter.php, line 81

Class

PrivateMessageThreadMessageFormatter
Defines the private message thread message field formatter.

Namespace

Drupal\private_message\Plugin\Field\FieldFormatter

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityManagerInterface $entityManager, AccountProxyInterface $currentUser, CsrfTokenGenerator $csrfTokenGenerator) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
  $this->entityManager = $entityManager;
  $this->currentUser = $currentUser;
  $this->csrfTokenGenerator = $csrfTokenGenerator;
  $this->userManager = $entityManager
    ->getStorage('user');
}