function UserCancelForm::__construct

Same name and namespace in other branches
  1. main core/modules/user/src/Form/UserCancelForm.php \Drupal\user\Form\UserCancelForm::__construct()

Constructs a ContentEntityForm object.

Parameters

\Drupal\Core\Entity\EntityRepositoryInterface $entity_repository: The entity repository service.

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle service.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

Overrides ContentEntityForm::__construct

File

core/modules/user/src/Form/UserCancelForm.php, line 46

Class

UserCancelForm
Provides a confirmation form for cancelling user account.

Namespace

Drupal\user\Form

Code

public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, ?NotificationHandler $notification_handler = NULL) {
  parent::__construct($entity_repository, $entity_type_bundle_info, $time);
  if ($notification_handler === NULL) {
    @trigger_error('Calling ' . __CLASS__ . ' constructor without the $notificationHandler argument is deprecated in drupal:11.5.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/node/3539363', E_USER_DEPRECATED);
  }
  $this->notificationHandler = $notification_handler ?? \Drupal::service(NotificationHandler::class);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.