function WorkflowDeleteForm::buildForm

Same name and namespace in other branches
  1. 9 core/modules/workflows/src/Form/WorkflowDeleteForm.php \Drupal\workflows\Form\WorkflowDeleteForm::buildForm()
  2. 8.9.x core/modules/workflows/src/Form/WorkflowDeleteForm.php \Drupal\workflows\Form\WorkflowDeleteForm::buildForm()
  3. 10 core/modules/workflows/src/Form/WorkflowDeleteForm.php \Drupal\workflows\Form\WorkflowDeleteForm::buildForm()

Overrides EntityConfirmFormBase::buildForm

File

core/modules/workflows/src/Form/WorkflowDeleteForm.php, line 19

Class

WorkflowDeleteForm
Builds the form to delete Workflow entities.

Namespace

Drupal\workflows\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
    if ($this->entity
        ->getTypePlugin()
        ->workflowHasData($this->entity)) {
        $form['#title'] = $this->getQuestion();
        $form['description'] = [
            '#markup' => $this->t('This workflow is in use. You cannot remove this workflow until you have removed all content using it.'),
        ];
        return $form;
    }
    return parent::buildForm($form, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.