You are here

public function IssueWidget::ajaxUpdateAll in Simplenews 8.2

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

Return the entire widget updated.

File

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

Class

IssueWidget
Plugin implementation of the 'simplenews_issue' widget.

Namespace

Drupal\simplenews\Plugin\Field\FieldWidget

Code

public function ajaxUpdateAll($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;
}