You are here

public function YamlFormSubmissionForm::draft in YAML Form 8

Form submission handler for the 'draft' action.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

File

src/YamlFormSubmissionForm.php, line 696

Class

YamlFormSubmissionForm
Provides a form to collect and edit submissions.

Namespace

Drupal\yamlform

Code

public function draft(array &$form, FormStateInterface $form_state) {
  $form_state
    ->clearErrors();
  $form_state
    ->setValue('in_draft', TRUE);
  $form_state
    ->set('draft_saved', TRUE);
  $this->entity
    ->validate();
}