class ComplexTestTypeConfigureForm

Same name in other branches
  1. 9 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeConfigureForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeConfigureForm
  2. 8.9.x core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeConfigureForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeConfigureForm
  3. 10 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeConfigureForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeConfigureForm

Form to configure the complex test workflow type.

Hierarchy

Expanded class hierarchy of ComplexTestTypeConfigureForm

See also

\Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType

File

core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeConfigureForm.php, line 15

Namespace

Drupal\workflow_type_test\Form
View source
class ComplexTestTypeConfigureForm extends WorkflowTypeConfigureFormBase {
    
    /**
     * {@inheritdoc}
     */
    public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
        $type_configuration = $this->workflowType
            ->getConfiguration();
        $form['example_setting'] = [
            '#type' => 'textfield',
            '#title' => $this->t('Example global workflow setting'),
            '#description' => $this->t('Extra information added to the workflow'),
            '#default_value' => $type_configuration['example_setting'],
        ];
        return $form;
    }
    
    /**
     * {@inheritdoc}
     */
    public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
        $type_configuration = $this->workflowType
            ->getConfiguration();
        $type_configuration['example_setting'] = $form_state->getValue('example_setting');
        $this->workflowType
            ->setConfiguration($type_configuration);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ComplexTestTypeConfigureForm::buildConfigurationForm public function Form constructor. Overrides PluginFormInterface::buildConfigurationForm
ComplexTestTypeConfigureForm::submitConfigurationForm public function Form submission handler. Overrides PluginFormInterface::submitConfigurationForm
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
WorkflowTypeConfigureFormBase::$workflowType protected property The workflow type.
WorkflowTypeConfigureFormBase::setPlugin public function Sets the plugin for this object. Overrides PluginAwareInterface::setPlugin
WorkflowTypeConfigureFormBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.