File

src/Form/QuicktabAddForm.php, line 187

Class

QuicktabAddForm
Class QuicktabAddForm

Namespace

Drupal\quicktabs\Form

Code

public function save(array $form, FormStateInterface $form_state) {
    $title = $form_state->getValue('title');
    $id = $form_state->getValue('id');
    $renderer = $form_state->getValue('renderer');
    $ajax = $form_state->getValue('ajax');
    $hide_empty_tabs = $form_state->getValue('hide_empty_tabs');
    $entity = $this->entity;
    $entity->set('title', $title);
    $entity->set('id', $id);
    $entity->set('renderer', $renderer);
    $entity->set('ajax', $ajax);
    $entity->set('hide_empty_tabs', $hide_empty_tabs);
    $status = $entity->save();
    if ($status == SAVED_NEW) {
        $form_state->setRedirect('quicktabs.list_tabs');
    }
}