You are here

public function ContactFormBlock::__construct in Form Block 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Block/ContactFormBlock.php \Drupal\formblock\Plugin\Block\ContactFormBlock::__construct()

Constructs a new ContactFormBlock plugin.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager: The entity manager.

\Drupal\Core\Session\AccountInterface $currentUser: The current user.

\Drupal\Core\Entity\EntityFormBuilderInterface $entityFormBuilder: The entity form builder interface.

\Drupal\Core\Config\ConfigFactoryInterface $configFactory: The config factory.

\Drupal\Core\Flood\FloodInterface $flood: The flood service.

\Drupal\Core\DateTime\DateFormatter $dateFormatter: The date formatter service.

Overrides BlockPluginTrait::__construct

File

src/Plugin/Block/ContactFormBlock.php, line 96

Class

ContactFormBlock
Provides a block for contact form.

Namespace

Drupal\formblock\Plugin\Block

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entityTypeManager, AccountInterface $currentUser, EntityFormBuilderInterface $entityFormBuilder, ConfigFactoryInterface $configFactory, FloodInterface $flood, DateFormatter $dateFormatter) {
  $this->entityTypeManager = $entityTypeManager;
  $this->currentUser = $currentUser;
  $this->entityFormBuilder = $entityFormBuilder;
  $this->configFactory = $configFactory;
  $this->flood = $flood;
  $this->dateFormatter = $dateFormatter;

  // We have to do this after our injections since the parent constructor
  // calls defaultConfiguration() which depends on the configFactory service.
  parent::__construct($configuration, $plugin_id, $plugin_definition);
}