You are here

public function UserRevisionDeleteForm::buildForm in User Revision 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 ConfirmFormBase::buildForm

File

src/Form/UserRevisionDeleteForm.php, line 82

Class

UserRevisionDeleteForm
Provides a form for delete a user revision.

Namespace

Drupal\user_revision\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $user = NULL, $user_revision = NULL) {
  $this->revision = $this->userStorage
    ->loadRevision($user_revision);
  if ($this->revision
    ->id() != $user) {
    throw new NotFoundHttpException();
  }
  return parent::buildForm($form, $form_state);
}