You are here

public function EntityconnectWidgetProcessor::__construct in Entity connect 8.2

Constructs a EntityconnectWidgetProcessor object.

Parameters

\Drupal\field\Entity\FieldConfig $field_definition: The entity reference field definition.

array $widget: The entity reference field widget form element.

File

src/EntityconnectWidgetProcessor.php, line 60

Class

EntityconnectWidgetProcessor
A reference field widget processing class for entityconnect module.

Namespace

Drupal\entityconnect

Code

public function __construct(FieldConfig $field_definition, array $widget) {
  $this->fieldDefinition = $field_definition;
  $this->widget = $widget;

  // Initialize entityconnect settings on the field.
  $this->entityconnectSettings = $this->fieldDefinition
    ->getThirdPartySettings('entityconnect');

  // Use global defaults if no settings on the field.
  if (!$this->entityconnectSettings) {
    $this->entityconnectSettings = \Drupal::config('entityconnect.administration_config')
      ->get();
  }

  // Initialize the target entity type and bundles.
  $this
    ->initTargetInfo();
}