You are here

public function KeyDeleteForm::buildForm in Key 8

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.

Return value

array The form structure.

Overrides EntityDeleteForm::buildForm

File

src/Form/KeyDeleteForm.php, line 39

Class

KeyDeleteForm
Builds the form to delete a Key.

Namespace

Drupal\key\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);

  // Allow the plugins to modify the form.
  foreach ($this->entity
    ->getPlugins() as $plugin) {
    if ($plugin instanceof KeyPluginDeleteFormInterface) {
      $plugin
        ->buildDeleteForm($form, $form_state);
    }
  }
  return $form;
}