public function DurationHumanDisplayFormatter::__construct in Duration Field 8.2
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldFormatter/DurationHumanDisplayFormatter.php \Drupal\duration_field\Plugin\Field\FieldFormatter\DurationHumanDisplayFormatter::__construct()
- 3.0.x src/Plugin/Field/FieldFormatter/DurationHumanDisplayFormatter.php \Drupal\duration_field\Plugin\Field\FieldFormatter\DurationHumanDisplayFormatter::__construct()
Constructs a DurationHumanDisplayFormatter object.
Parameters
string $plugin_id: The ID of the plugin.
mixed $plugin_definition: The plugin definition.
mixed $field_config: The field definition.
array $settings: The field settings.
mixed $label: The label of the field.
string $view_mode: The current view mode.
array $third_party_settings: The third party settings.
\Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler: The module handler service.
\Drupal\duration_field\Service\GranularityServiceInterface $granularityService: The granularity service.
\Drupal\duration_field\Service\DurationServiceInterface $durationService: The duration service.
Overrides FormatterBase::__construct
File
- src/
Plugin/ Field/ FieldFormatter/ DurationHumanDisplayFormatter.php, line 72
Class
- DurationHumanDisplayFormatter
- Provides a human friendly formatter for the Duration field type.
Namespace
Drupal\duration_field\Plugin\Field\FieldFormatterCode
public function __construct($plugin_id, $plugin_definition, $field_config, array $settings, $label, $view_mode, array $third_party_settings, ModuleHandlerInterface $moduleHandler, GranularityServiceInterface $granularityService, DurationServiceInterface $durationService) {
parent::__construct($plugin_id, $plugin_definition, $field_config, $settings, $label, $view_mode, $third_party_settings);
$this->moduleHandler = $moduleHandler;
$this->granularityService = $granularityService;
$this->durationService = $durationService;
}