public function EntityReferenceTableFormatter::__construct in Reference Table Formatter 2.0.x
Constructs a new ReferenceTableFormatter.
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\reference_table_formatter\EntityToTableRendererInterface $reference_renderer: The entity-to-table renderer.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The Entity type manager.
\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository.
Overrides FormatterBase::__construct
File
- src/
Plugin/ Field/ FieldFormatter/ EntityReferenceTableFormatter.php, line 91
Class
- EntityReferenceTableFormatter
- A field formatter to display a table.
Namespace
Drupal\reference_table_formatter\Plugin\Field\FieldFormatterCode
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityToTableRendererInterface $reference_renderer, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
$this->referenceRenderer = $reference_renderer;
$this->entityTypeManager = $entity_type_manager;
$this->entityDisplayRepository = $entity_display_repository;
}