You are here

function multiple_registration_field_config_form_submit in Multiple Registration 8

Same name and namespace in other branches
  1. 8.2 multiple_registration.module \multiple_registration_field_config_form_submit()
  2. 3.x multiple_registration.module \multiple_registration_field_config_form_submit()

Form submit to save additional field settings.

Parameters

array $form: Form data array.

\Drupal\Core\Form\FormStateInterface $form_state: Form state object.

1 string reference to 'multiple_registration_field_config_form_submit'
multiple_registration_form_field_config_edit_form_alter in ./multiple_registration.module
Implements hook_form_FORM_ID_alter().

File

./multiple_registration.module, line 160
Contains multiple_registration.module.

Code

function multiple_registration_field_config_form_submit(array &$form, FormStateInterface $form_state) {
  $data = $form_state
    ->getValue('multiple_registration');
  $data_required = $form_state
    ->getValue('multiple_registration_required');
  $field = $form_state
    ->getFormObject()
    ->getEntity();
  $field
    ->setThirdPartySetting('multiple_registration', 'user_additional_register_form', $data);
  $field
    ->setThirdPartySetting('multiple_registration', 'user_additional_register_form_required', $data_required);
  $field
    ->save();
}