You are here

public function Login::__construct in Commerce Core 8.2

Constructs a new Login object.

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\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowInterface $checkout_flow: The parent checkout flow.

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

\Drupal\commerce\CredentialsCheckFloodInterface $credentials_check_flood: The credentials check flood controller.

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

\Drupal\user\UserAuthInterface $user_auth: The user authentication object.

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

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

Overrides CheckoutPaneBase::__construct

File

modules/checkout/src/Plugin/Commerce/CheckoutPane/Login.php, line 89

Class

Login
Provides the login pane.

Namespace

Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, CheckoutFlowInterface $checkout_flow, EntityTypeManagerInterface $entity_type_manager, CredentialsCheckFloodInterface $credentials_check_flood, AccountInterface $current_user, UserAuthInterface $user_auth, RequestStack $request_stack, LanguageManagerInterface $language_manager = NULL) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $checkout_flow, $entity_type_manager);
  $this->credentialsCheckFlood = $credentials_check_flood;
  $this->currentUser = $current_user;
  $this->userAuth = $user_auth;
  $this->clientIp = $request_stack
    ->getCurrentRequest()
    ->getClientIp();
  if (!$language_manager) {
    @trigger_error('Calling ' . __METHOD__ . '() without the $language_manager argument is deprecated in commerce:8.x-2.25 and is removed from commerce:3.x.');
    $language_manager = \Drupal::languageManager();
  }
  $this->languageManager = $language_manager;
}