Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / workflows / tests / modules / workflow_type_test / src / Form / ComplexTestTypeConfigureForm.php
1 <?php
2
3 namespace Drupal\workflow_type_test\Form;
4
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\workflows\Plugin\WorkflowTypeConfigureFormBase;
7
8 /**
9  * Form to configure the complex test workflow type.
10  *
11  * @see \Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType
12  */
13 class ComplexTestTypeConfigureForm extends WorkflowTypeConfigureFormBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
19     $type_configuration = $this->workflowType->getConfiguration();
20     $form['example_setting'] = [
21       '#type' => 'textfield',
22       '#title' => $this->t('Example global workflow setting'),
23       '#description' => $this->t('Extra information added to the workflow'),
24       '#default_value' => $type_configuration['example_setting'],
25     ];
26     return $form;
27   }
28
29   /**
30    * {@inheritdoc}
31    */
32   public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
33     $type_configuration = $this->workflowType->getConfiguration();
34     $type_configuration['example_setting'] = $form_state->getValue('example_setting');
35     $this->workflowType->setConfiguration($type_configuration);
36   }
37
38 }