You are here

public function MessageForm::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/contact/src/MessageForm.php \Drupal\contact\MessageForm::__construct()
  2. 9 core/modules/contact/src/MessageForm.php \Drupal\contact\MessageForm::__construct()

Constructs a MessageForm object.

Parameters

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

\Drupal\Core\Flood\FloodInterface $flood: The flood control mechanism.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager service.

\Drupal\contact\MailHandlerInterface $mail_handler: The contact mail handler service.

\Drupal\Core\Datetime\DateFormatterInterface $date_formatter: The date 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/contact/src/MessageForm.php, line 75

Class

MessageForm
Form controller for contact message forms.

Namespace

Drupal\contact

Code

public function __construct(EntityRepositoryInterface $entity_repository, FloodInterface $flood, LanguageManagerInterface $language_manager, MailHandlerInterface $mail_handler, DateFormatterInterface $date_formatter, EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, TimeInterface $time = NULL) {
  parent::__construct($entity_repository, $entity_type_bundle_info, $time);
  $this->flood = $flood;
  $this->languageManager = $language_manager;
  $this->mailHandler = $mail_handler;
  $this->dateFormatter = $date_formatter;
}