You are here

protected function DynamicEntityReferenceWidget::getSelectionHandlerSetting in Dynamic Entity Reference 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php \Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget\DynamicEntityReferenceWidget::getSelectionHandlerSetting()

Returns the value of a setting for the dynamic entity reference handler.

Parameters

string $setting_name: The setting name.

string $target_type: The id of the target entity type.

Return value

mixed The setting value.

Overrides EntityReferenceAutocompleteWidget::getSelectionHandlerSetting

3 calls to DynamicEntityReferenceWidget::getSelectionHandlerSetting()
DynamicEntityReferenceWidget::elementValidate in src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php
DynamicEntityReferenceWidget::formElement in src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php
Returns the form for a single field widget.
DynamicEntityReferenceWidget::getAutocreateBundle in src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php
Returns the name of the bundle which will be used for autocreated entities.

File

src/Plugin/Field/FieldWidget/DynamicEntityReferenceWidget.php, line 210

Class

DynamicEntityReferenceWidget
Plugin implementation of the 'dynamic_entity_reference autocomplete' widget.

Namespace

Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget

Code

protected function getSelectionHandlerSetting($setting_name, $target_type = NULL) {
  if ($target_type === NULL) {
    return parent::getSelectionHandlerSetting($setting_name);
  }
  $settings = $this
    ->getFieldSettings();
  return isset($settings[$target_type]['handler_settings'][$setting_name]) ? $settings[$target_type]['handler_settings'][$setting_name] : NULL;
}