File
-
src/
Form/ QuicktabCloneForm.php, line 188
Class
- QuicktabCloneForm
- Class QuicktabCloneForm
Namespace
Drupal\quicktabs\FormCode
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');
$this->entity = $this->entity
->createDuplicate();
$this->entity
->set('title', $title);
$this->entity
->set('id', $id);
$this->entity
->set('renderer', $renderer);
$this->entity
->set('ajax', $ajax);
$this->entity
->set('hide_empty_tabs', $hide_empty_tabs);
$status = $this->entity
->save();
if ($status == SAVED_NEW) {
$form_state->setRedirect('quicktabs.list_tabs');
drupal_set_message($this->t('Settings have been copied to new quicktabs!'));
}
}