class WorkflowTypeStateFormBase
Same name and namespace in other branches
- 11.x core/modules/workflows/src/Plugin/WorkflowTypeStateFormBase.php \Drupal\workflows\Plugin\WorkflowTypeStateFormBase
- 10 core/modules/workflows/src/Plugin/WorkflowTypeStateFormBase.php \Drupal\workflows\Plugin\WorkflowTypeStateFormBase
- 9 core/modules/workflows/src/Plugin/WorkflowTypeStateFormBase.php \Drupal\workflows\Plugin\WorkflowTypeStateFormBase
- 8.9.x core/modules/workflows/src/Plugin/WorkflowTypeStateFormBase.php \Drupal\workflows\Plugin\WorkflowTypeStateFormBase
A base class for workflow type state forms.
Hierarchy
- class \Drupal\workflows\Plugin\WorkflowTypeStateFormBase implements \Drupal\Core\Plugin\PluginFormInterface, \Drupal\Component\Plugin\PluginAwareInterface uses \Drupal\Core\StringTranslation\StringTranslationTrait
Expanded class hierarchy of WorkflowTypeStateFormBase
2 files declare their use of WorkflowTypeStateFormBase
- ComplexTestTypeStateForm.php in core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Form/ ComplexTestTypeStateForm.php - ContentModerationStateForm.php in core/
modules/ content_moderation/ src/ Form/ ContentModerationStateForm.php
File
-
core/
modules/ workflows/ src/ Plugin/ WorkflowTypeStateFormBase.php, line 14
Namespace
Drupal\workflows\PluginView source
abstract class WorkflowTypeStateFormBase implements PluginFormInterface, PluginAwareInterface {
use StringTranslationTrait;
/**
* The workflow type.
*
* @var \Drupal\workflows\WorkflowTypeInterface
*/
protected $workflowType;
/**
* {@inheritdoc}
*/
public function setPlugin(PluginInspectionInterface $plugin) {
$this->workflowType = $plugin;
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
$values = $form_state->getValues();
$state = $form_state->get('state');
$configuration = $this->workflowType
->getConfiguration();
$configuration['states'][$state->id()] = $values + $configuration['states'][$state->id()];
$this->workflowType
->setConfiguration($configuration);
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.