You are here

public function LeafletDefaultFormatter::__construct in Leaflet 2.1.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php \Drupal\leaflet\Plugin\Field\FieldFormatter\LeafletDefaultFormatter::__construct()
  2. 2.0.x src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php \Drupal\leaflet\Plugin\Field\FieldFormatter\LeafletDefaultFormatter::__construct()

LeafletDefaultFormatter 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: Any third party settings settings.

\Drupal\Leaflet\LeafletService $leaflet_service: The Leaflet service.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The Entity Field Manager.

\Drupal\core\Utility\Token $token: The token service.

\Drupal\core\Render\Renderer $renderer: The renderer service.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Utility\LinkGeneratorInterface $link_generator: The Link Generator service.

Overrides FormatterBase::__construct

File

src/Plugin/Field/FieldFormatter/LeafletDefaultFormatter.php, line 116

Class

LeafletDefaultFormatter
Plugin implementation of the 'leaflet_default' formatter.

Namespace

Drupal\leaflet\Plugin\Field\FieldFormatter

Code

public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, LeafletService $leaflet_service, EntityFieldManagerInterface $entity_field_manager, Token $token, Renderer $renderer, ModuleHandlerInterface $module_handler, LinkGeneratorInterface $link_generator) {
  parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
  $this->defaultSettings = self::getDefaultSettings();
  $this->leafletService = $leaflet_service;
  $this->entityFieldManager = $entity_field_manager;
  $this->token = $token;
  $this->renderer = $renderer;
  $this->moduleHandler = $module_handler;
  $this->link = $link_generator;
}