You are here

public function InviteLinkBlockForm::submitForm in Invite 8

Form submission handler.

Parameters

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

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

Overrides FormInterface::submitForm

File

modules/invite_link/src/Form/InviteLinkBlockForm.php, line 60

Class

InviteLinkBlockForm
Class InviteLinkBlockForm.

Namespace

Drupal\invite_link\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $invite_type = $form_state
    ->getBuildInfo()['args'][0];
  $invite = Invite::create([
    'type' => $invite_type,
  ]);
  $invite
    ->setPlugin('invite_link');
  $invite
    ->save();
  $form_state
    ->setTemporaryValue('invite', $invite);
}