public function BookSettingsForm::submitForm

Implements \Drupal\Core\Form\FormInterface::submitForm().

Overrides SystemConfigFormBase::submitForm

File

drupal/core/modules/book/lib/Drupal/book/BookSettingsForm.php, line 65
Contains \Drupal\book\BookSettingsForm.

Class

BookSettingsForm
Configure book settings for this site.

Namespace

Drupal\book

Code

public function submitForm(array &$form, array &$form_state) {
  $allowed_types = array_filter($form_state['values']['book_allowed_types']);

  // We need to save the allowed types in an array ordered by machine_name so
  // that we can save them in the correct order if node type changes.
  // @see book_node_type_update().
  sort($allowed_types);
  $this->configFactory
    ->get('book.settings')
    ->set('allowed_types', $allowed_types)
    ->set('child_type', $form_state['values']['book_child_type'])
    ->save();
  parent::submitForm($form, $form_state);
}