You are here

public function WebformEntityReferenceFormatterBase::__construct in Webform 8.5

WebformEntityReferenceFormatterBase constructor.

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: Third party settings.

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

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The factory for configuration objects.

Overrides FormatterBase::__construct

2 calls to WebformEntityReferenceFormatterBase::__construct()
WebformEntityReferenceEntityFormatter::__construct in src/Plugin/Field/FieldFormatter/WebformEntityReferenceEntityFormatter.php
WebformEntityReferenceEntityFormatter constructor.
WebformEntityReferenceLinkFormatter::__construct in src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php
WebformEntityReferenceLinkFormatter constructor.
2 methods override WebformEntityReferenceFormatterBase::__construct()
WebformEntityReferenceEntityFormatter::__construct in src/Plugin/Field/FieldFormatter/WebformEntityReferenceEntityFormatter.php
WebformEntityReferenceEntityFormatter constructor.
WebformEntityReferenceLinkFormatter::__construct in src/Plugin/Field/FieldFormatter/WebformEntityReferenceLinkFormatter.php
WebformEntityReferenceLinkFormatter constructor.

File

src/Plugin/Field/FieldFormatter/WebformEntityReferenceFormatterBase.php, line 63

Class

WebformEntityReferenceFormatterBase
Base class for 'Webform Entity Reference formatter' plugin implementations.

Namespace

Drupal\webform\Plugin\Field\FieldFormatter

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, RendererInterface $renderer, ConfigFactoryInterface $config_factory) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
  $this->configFactory = $config_factory;
  $this->renderer = $renderer;

  // Make sure the time object is defined because the create method maybe
  // overridden and we can't alter the constructor without breaking classes
  // which extend the WebformEntityReferenceFormatterBase class.
  // @todo Remove in Webform 6.x.
  $this->time = \Drupal::service('datetime.time');
}