function WorkflowAddForm::copyFormValuesToEntity
Same name in other branches
- 9 core/modules/workflows/src/Form/WorkflowAddForm.php \Drupal\workflows\Form\WorkflowAddForm::copyFormValuesToEntity()
- 10 core/modules/workflows/src/Form/WorkflowAddForm.php \Drupal\workflows\Form\WorkflowAddForm::copyFormValuesToEntity()
- 11.x core/modules/workflows/src/Form/WorkflowAddForm.php \Drupal\workflows\Form\WorkflowAddForm::copyFormValuesToEntity()
Overrides EntityForm::copyFormValuesToEntity
File
-
core/
modules/ workflows/ src/ Form/ WorkflowAddForm.php, line 106
Class
- WorkflowAddForm
- Form for adding workflows.
Namespace
Drupal\workflows\FormCode
protected function copyFormValuesToEntity(EntityInterface $entity, array $form, FormStateInterface $form_state) {
// This form can only set the workflow's ID, label and the weights for each
// state.
/** @var \Drupal\workflows\WorkflowInterface $entity */
$values = $form_state->getValues();
$entity->set('label', $values['label']);
$entity->set('id', $values['id']);
$entity->set('type', $values['workflow_type']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.