public function UserCancelForm::getDescription in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/Form/UserCancelForm.php \Drupal\user\Form\UserCancelForm::getDescription()
- 9 core/modules/user/src/Form/UserCancelForm.php \Drupal\user\Form\UserCancelForm::getDescription()
File
- core/modules/user/src/Form/UserCancelForm.php, line 56
Class
- UserCancelForm
- Provides a confirmation form for cancelling user account.
Namespace
Drupal\user\Form
Code
public function getDescription() {
if ($this->selectCancel) {
return '';
}
$default_method = $this
->config('user.settings')
->get('cancel_method');
$own_account = $this->entity
->id() == $this
->currentUser()
->id();
if ($own_account && isset($this->cancelMethods[$default_method]['#confirm_description'])) {
return $this->cancelMethods[$default_method]['#confirm_description'];
}
return $this->cancelMethods['#options'][$default_method];
}