You are here

public function WorkflowConfigTransitionLabelForm::submitForm in Workflow 8

Form submission handler.

Parameters

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

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

Overrides ConfigFormBase::submitForm

File

src/Form/WorkflowConfigTransitionLabelForm.php, line 92

Class

WorkflowConfigTransitionLabelForm
Defines a class to build a draggable listing of Workflow Config Transitions entities.

Namespace

Drupal\workflow\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  foreach ($form_state
    ->getValue($this->entitiesKey) as $value) {
    $new_label = trim($value['label_new']);
    $value['config_transition']
      ->set('label', $new_label)
      ->save();
  }
  $this
    ->messenger()
    ->addStatus($this
    ->t('The transition labels have been saved.'));
}