function MessageForm::__construct

Same name and namespace in other branches
  1. 9 core/modules/contact/src/MessageForm.php \Drupal\contact\MessageForm::__construct()
  2. 8.9.x core/modules/contact/src/MessageForm.php \Drupal\contact\MessageForm::__construct()
  3. 10 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;
}

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