You are here

public function IssueWidget::ajaxUpdateRecipientHandlerSettings in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/IssueWidget.php \Drupal\simplenews\Plugin\Field\FieldWidget\IssueWidget::ajaxUpdateRecipientHandlerSettings()

Return the updated recipient handler settings field.

File

src/Plugin/Field/FieldWidget/IssueWidget.php, line 175

Class

IssueWidget
Plugin implementation of the 'simplenews_issue' widget.

Namespace

Drupal\simplenews\Plugin\Field\FieldWidget

Code

public function ajaxUpdateRecipientHandlerSettings($form, FormStateInterface $form_state) {

  // Determine the field name from the triggering element.
  $button = $form_state
    ->getTriggeringElement();
  $element = NestedArray::getValue($form, array_slice($button['#array_parents'], 0, -1));
  return $element['handler_settings'];
}