You are here

public function HubspotWebformHandler::updateSubscriptionSource in HubSpot 3.x

Ajax call back for removing subscription mapping row.

Parameters

array $form: Drupal form render array.

\Drupal\Core\Form\FormStateInterface $form_state: Drupal form state for ajax callback.

Return value

mixed Drupal ajax response.

File

src/Plugin/WebformHandler/HubspotWebformHandler.php, line 592

Class

HubspotWebformHandler
Webform submission remote post handler.

Namespace

Drupal\hubspot\Plugin\WebformHandler

Code

public function updateSubscriptionSource(array &$form, FormStateInterface $form_state) {
  $trigger = $form_state
    ->getTriggeringElement();
  $element_path = $trigger['#parents'];
  array_pop($element_path);
  $elem = NestedArray::getValue($form, $element_path);
  return $elem;
}