public function UserRevisionRevertForm::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/ UserRevisionRevertForm.php, line 88
Class
- UserRevisionRevertForm
- Provides a form for reverting a user revision.
Namespace
Drupal\user_revision\FormCode
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);
}