You are here

public function FileDownloadLink::__construct in File Download Link 8

Constructs a FileDownloadLink object.

Parameters

string $plugin_id: The plugin_id for the formatter.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the formatter is associated.

array $settings: The formatter settings.

string $label: The formatter label display setting.

string $view_mode: The view mode.

array $third_party_settings: Any third party settings.

\Drupal\Core\Utility\Token $token: Token service.

\Drupal\Core\Extension\ModuleHandler $module_handler: Module handler service.

\Drupal\token\TokenEntityMapper|null $token_entity_mapper: Token entity mapper if token module is installed. Otherwise NULL.

Overrides FormatterBase::__construct

File

src/Plugin/Field/FieldFormatter/FileDownloadLink.php, line 76

Class

FileDownloadLink
Plugin implementation of the 'file_download_link' formatter.

Namespace

Drupal\file_download_link\Plugin\Field\FieldFormatter

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, Token $token, ModuleHandler $module_handler, $token_entity_mapper) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
  $this->token = $token;
  $this->moduleHandler = $module_handler;
  $this->tokenEntityMapper = $token_entity_mapper;
}