public function ConnectionTypeForm::updateBundleOptions in RedHen CRM 8
Ajax callback to update the bundle options.
Parameters
$form:
\Drupal\Core\Form\FormStateInterface $form_state:
Return value
mixed
File
- modules/
redhen_connection/ src/ Form/ ConnectionTypeForm.php, line 184
Class
- ConnectionTypeForm
- Class ConnectionTypeForm.
Namespace
Drupal\redhen_connection\FormCode
public function updateBundleOptions($form, FormStateInterface $form_state) {
$element = $form_state
->getTriggeringElement();
$endpoint = $element['#array_parents'][1];
$endpoint_type = $element['#value'];
$form['endpoints'][$endpoint]['bundles']['#options'] = $this
->getBundleOptions($endpoint_type);
return $form['endpoints'][$endpoint]['bundles'];
}