You are here

public function ForwardForm::__construct in Forward 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::__construct()
  2. 8 src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::__construct()
  3. 8.2 src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::__construct()
  4. 4.x src/Form/ForwardForm.php \Drupal\forward\Form\ForwardForm::__construct()

Constructs a Forward Form.

Parameters

mixed $entity: The entity being forwarded or NULL.

Drupal\Core\Routing\RouteMatchInterface $route_match: The core route match interface.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler service.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Database\Connection $database: The database connection.

\Drupal\Core\Utility\Token $token_service: The token service.

\Drupal\Core\Flood\FloodInterface $flood_interface: The flood interface.

\Drupal\Core\Session\AccountSwitcherInterface $account_switcher: The account switcher service.

\Drupal\Core\Render\RendererInterface $renderer: The render service.

\Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher $event_dispatcher: The event dispatcher service.

\Drupal\Core\Mail\MailManager $mailer: The mail service.

\Drupal\Core\Utility\LinkGeneratorInterface $link_generator: The link generation service.

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

Egulias\EmailValidator\EmailValidator $email_validator: The email validation service.

File

src/Form/ForwardForm.php, line 182

Class

ForwardForm
Forward a page to a friend.

Namespace

Drupal\forward\Form

Code

public function __construct($entity, RouteMatchInterface $route_match, ModuleHandlerInterface $module_handler, EntityTypeManagerInterface $entity_type_manager, RequestStack $request_stack, Connection $database, Token $token_service, FloodInterface $flood_interface, AccountSwitcherInterface $account_switcher, RendererInterface $renderer, ContainerAwareEventDispatcher $event_dispatcher, MailManager $mailer, LinkGeneratorInterface $link_generator, TimeInterface $time, EmailValidator $email_validator) {
  $this->time = $time;
  $this->entity = $entity ?? $route_match
    ->getParameter('entity');
  $this->moduleHandler = $module_handler;
  $this->entityTypeManager = $entity_type_manager;
  $this->requestStack = $request_stack;
  $this->database = $database;
  $this->tokenService = $token_service;
  $this->floodInterface = $flood_interface;
  $this->accountSwitcher = $account_switcher;
  $this->renderer = $renderer;
  $this->eventDispatcher = $event_dispatcher;
  $this->mailer = $mailer;
  $this->linkGenerator = $link_generator;
  $this->emailValidator = $email_validator;
  $settings = $this
    ->config('forward.settings')
    ->get();
  $this->settings = $settings;
}