You are here

public function GeneralEntityReferenceFormatter::__construct in Formatter Suite 8

Constructs a FormatterBase object.

Parameters

string $pluginId: The pluginId for the formatter.

mixed $pluginDefinition: The plugin implementation definition.

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

array $settings: The formatter settings.

string $label: The formatter label display setting.

string $viewMode: The view mode.

array $thirdPartySettings: Any third party settings.

\Drupal\Core\Utility\Token $tokenService: The token replacement service.

\Drupal\token\TreeBuilder|null $tokenTreeBuilder: The token selection UI builder, if the Token module is enabled.

Overrides FormatterBase::__construct

File

src/Plugin/Field/FieldFormatter/GeneralEntityReferenceFormatter.php, line 99

Class

GeneralEntityReferenceFormatter
Formats an entity reference as one or more links.

Namespace

Drupal\formatter_suite\Plugin\Field\FieldFormatter

Code

public function __construct($pluginId, $pluginDefinition, FieldDefinitionInterface $fieldDefinition, array $settings, $label, $viewMode, array $thirdPartySettings, Token $tokenService, $tokenTreeBuilder) {
  parent::__construct($pluginId, $pluginDefinition, $fieldDefinition, $settings, $label, $viewMode, $thirdPartySettings);
  $this->tokenService = $tokenService;
  $this->tokenTreeBuilder = $tokenTreeBuilder;
}