You are here

public function NameFormatter::__construct in Name Field 8

Same name in this branch
  1. 8 src/NameFormatter.php \Drupal\name\NameFormatter::__construct()
  2. 8 src/Plugin/Field/FieldFormatter/NameFormatter.php \Drupal\name\Plugin\Field\FieldFormatter\NameFormatter::__construct()

Constructs a NameFormatter instance.

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 settings.

\Drupal\Core\Entity\EntityFieldManager $entityFieldManager: The entity field manager.

\Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager: The entity type manager.

\Drupal\Core\Render\RendererInterface $renderer: The rendering service.

\Drupal\name\NameFormatter $formatter: The name formatter.

\Drupal\name\NameFormatParser $parser: The name format parser.

\Drupal\name\NameGeneratorInterface $generator: The name format parser.

Overrides FormatterBase::__construct

File

src/Plugin/Field/FieldFormatter/NameFormatter.php, line 115

Class

NameFormatter
Plugin implementation of the 'name' formatter.

Namespace

Drupal\name\Plugin\Field\FieldFormatter

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityFieldManager $entityFieldManager, EntityTypeManagerInterface $entityTypeManager, RendererInterface $renderer, NameFormatterService $formatter, NameFormatParser $parser, NameGeneratorInterface $generator) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
  $this->entityFieldManager = $entityFieldManager;
  $this->entityTypeManager = $entityTypeManager;
  $this->renderer = $renderer;
  $this->formatter = $formatter;
  $this->parser = $parser;
  $this->generator = $generator;
}