function ContentModerationConfigureEntityTypesForm::submitForm
Same name in other branches
- 8.9.x core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php \Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::submitForm()
- 10 core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php \Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::submitForm()
- 11.x core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php \Drupal\content_moderation\Form\ContentModerationConfigureEntityTypesForm::submitForm()
Overrides FormInterface::submitForm
File
-
core/
modules/ content_moderation/ src/ Form/ ContentModerationConfigureEntityTypesForm.php, line 181
Class
- ContentModerationConfigureEntityTypesForm
- The form for editing entity types associated with a workflow.
Namespace
Drupal\content_moderation\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
foreach ($form_state->getValue('bundles') as $bundle_id => $checked) {
if ($checked) {
$this->workflow
->getTypePlugin()
->addEntityTypeAndBundle($this->entityType
->id(), $bundle_id);
}
else {
$this->workflow
->getTypePlugin()
->removeEntityTypeAndBundle($this->entityType
->id(), $bundle_id);
}
}
$this->workflow
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.