You are here

public function WorkflowTransitionDeleteForm::buildForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php \Drupal\workflows\Form\WorkflowTransitionDeleteForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\workflows\WorkflowInterface $workflow: The workflow entity being edited.

string|null $workflow_transition: The workflow transition being deleted.

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php, line 81

Class

WorkflowTransitionDeleteForm
Builds the form to delete transitions from Workflow entities.

Namespace

Drupal\workflows\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, WorkflowInterface $workflow = NULL, $workflow_transition = NULL) {
  try {
    $this->transition = $workflow
      ->getTypePlugin()
      ->getTransition($workflow_transition);
  } catch (\InvalidArgumentException $e) {
    throw new NotFoundHttpException();
  }
  $this->workflow = $workflow;
  return parent::buildForm($form, $form_state);
}