public function PrivateMessageThreadMessageFormatter::__construct in Private Message 8.2
Same name and namespace in other branches
- 8 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\EntityTypeManagerInterface $entityTypeManager: The entity manager service.
|Drupal\Core\Session\AccountProxyInterface $currentUser: The current user.
\Drupal\Core\Access\CsrfTokenGenerator $csrfTokenGenerator: The CSRF token generator.
\Drupal\Core\Config\ConfigFactoryInterface $configFactory: The configuration factory.
\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository.
Overrides FormatterBase::__construct
File
- src/
Plugin/ Field/ FieldFormatter/ PrivateMessageThreadMessageFormatter.php, line 101
Class
- PrivateMessageThreadMessageFormatter
- Defines the private message thread message field formatter.
Namespace
Drupal\private_message\Plugin\Field\FieldFormatterCode
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityTypeManagerInterface $entityTypeManager, AccountProxyInterface $currentUser, CsrfTokenGenerator $csrfTokenGenerator, ConfigFactoryInterface $configFactory, EntityDisplayRepositoryInterface $entity_display_repository) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
$this->entityTypeManager = $entityTypeManager;
$this->currentUser = $currentUser;
$this->csrfTokenGenerator = $csrfTokenGenerator;
$this->userManager = $entityTypeManager
->getStorage('user');
$this->config = $configFactory
->get('private_message.settings');
$this->entityDisplayRepository = $entity_display_repository;
}