You are here

class ComplexTestTypeStateForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeStateForm
  2. 9 core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php \Drupal\workflow_type_test\Form\ComplexTestTypeStateForm

Form to configure the complex test workflow states.

Hierarchy

Expanded class hierarchy of ComplexTestTypeStateForm

See also

\Drupal\workflow_type_test\Plugin\WorkflowType\ComplexTestType

File

core/modules/workflows/tests/modules/workflow_type_test/src/Form/ComplexTestTypeStateForm.php, line 13

Namespace

Drupal\workflow_type_test\Form
View source
class ComplexTestTypeStateForm extends WorkflowTypeStateFormBase {

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $state = $form_state
      ->get('state');
    $configuration = $this->workflowType
      ->getConfiguration();
    $form['extra'] = [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Extra'),
      '#description' => $this
        ->t('Extra information added to state'),
      '#default_value' => $state && isset($configuration['states'][$state
        ->id()]['extra']) ? $configuration['states'][$state
        ->id()]['extra'] : '',
    ];
    return $form;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ComplexTestTypeStateForm::buildConfigurationForm public function Form constructor. Overrides PluginFormInterface::buildConfigurationForm
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. 1
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
WorkflowTypeStateFormBase::$workflowType protected property The workflow type.
WorkflowTypeStateFormBase::setPlugin public function Sets the plugin for this object. Overrides PluginAwareInterface::setPlugin
WorkflowTypeStateFormBase::submitConfigurationForm public function Form submission handler. Overrides PluginFormInterface::submitConfigurationForm
WorkflowTypeStateFormBase::validateConfigurationForm public function Form validation handler. Overrides PluginFormInterface::validateConfigurationForm