public function EntityReferenceLayoutWidget::__construct in Entity Reference with Layout 8
Constructs a WidgetBase object.
Parameters
string $plugin_id: The plugin_id for the widget.
mixed $plugin_definition: The plugin implementation definition.
\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The definition of the field to which the widget is associated.
array $settings: The widget settings.
array $third_party_settings: Any third party settings.
\Drupal\Core\Render\Renderer $renderer: Core renderer service.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: Core entity type manager service.
\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle info.
\Drupal\Core\Layout\LayoutPluginManager $layout_plugin_manager: Core layout plugin manager service.
\Drupal\Core\Plugin\PluginFormFactoryInterface $plugin_form_manager: The plugin form manager.
\Drupal\Core\Language\LanguageManager $language_manager: Core language manager service.
\Drupal\Core\Session\AccountProxyInterface $current_user: The current user.
\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository.
Overrides WidgetBase::__construct
File
- src/
Plugin/ Field/ FieldWidget/ EntityReferenceLayoutWidget.php, line 172
Class
- EntityReferenceLayoutWidget
- Entity Reference with Layout field widget.
Namespace
Drupal\entity_reference_layout\Plugin\Field\FieldWidgetCode
public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, Renderer $renderer, EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, LayoutPluginManager $layout_plugin_manager, PluginFormFactoryInterface $plugin_form_manager, LanguageManager $language_manager, AccountProxyInterface $current_user, EntityDisplayRepositoryInterface $entity_display_repository) {
parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
$this->renderer = $renderer;
$this->entityTypeManager = $entity_type_manager;
$this->entityTypeBundleInfo = $entity_type_bundle_info;
$this->layoutPluginManager = $layout_plugin_manager;
$this->pluginFormFactory = $plugin_form_manager;
$this->fieldName = $this->fieldDefinition
->getName();
$this->languageManager = $language_manager;
$this->currentUser = $current_user;
$this->entityDisplayRepository = $entity_display_repository;
}