public function EnrollRequestDeclineForm::submitForm in Open Social 10.2.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php \Drupal\social_event\Form\EnrollRequestDeclineForm::submitForm()
- 10.3.x modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php \Drupal\social_event\Form\EnrollRequestDeclineForm::submitForm()
- 10.0.x modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php \Drupal\social_event\Form\EnrollRequestDeclineForm::submitForm()
- 10.1.x modules/social_features/social_event/src/Form/EnrollRequestDeclineForm.php \Drupal\social_event\Form\EnrollRequestDeclineForm::submitForm()
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/
social_features/ social_event/ src/ Form/ EnrollRequestDeclineForm.php, line 154
Class
- EnrollRequestDeclineForm
- Class EnrollRequestDeclineForm.
Namespace
Drupal\social_event\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
if (!empty($this->eventEnrollment)) {
$this->eventEnrollment->field_request_or_invite_status->value = EventEnrollmentInterface::REQUEST_OR_INVITE_DECLINED;
$this->eventEnrollment
->save();
}
$this
->messenger()
->addStatus($this
->t('The enrollment request of @name has been declined.', [
'@name' => $this->fullName,
]));
$form_state
->setRedirectUrl($this
->getCancelUrl());
}