You are here

public function AddToCartForm::__construct in Commerce Core 8.2

Constructs a new AddToCartForm object.

Parameters

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

\Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info: The entity type bundle info.

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

\Drupal\commerce_cart\CartManagerInterface $cart_manager: The cart manager.

\Drupal\commerce_cart\CartProviderInterface $cart_provider: The cart provider.

\Drupal\commerce_order\Resolver\OrderTypeResolverInterface $order_type_resolver: The order type resolver.

\Drupal\commerce_store\CurrentStoreInterface $current_store: The current store.

\Drupal\commerce_price\Resolver\ChainPriceResolverInterface $chain_price_resolver: The chain base price resolver.

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

Overrides ContentEntityForm::__construct

File

modules/cart/src/Form/AddToCartForm.php, line 99

Class

AddToCartForm
Provides the order item add to cart form.

Namespace

Drupal\commerce_cart\Form

Code

public function __construct(EntityRepositoryInterface $entity_repository, EntityTypeBundleInfoInterface $entity_type_bundle_info, TimeInterface $time, CartManagerInterface $cart_manager, CartProviderInterface $cart_provider, OrderTypeResolverInterface $order_type_resolver, CurrentStoreInterface $current_store, ChainPriceResolverInterface $chain_price_resolver, AccountInterface $current_user) {
  parent::__construct($entity_repository, $entity_type_bundle_info, $time);
  $this->cartManager = $cart_manager;
  $this->cartProvider = $cart_provider;
  $this->orderTypeResolver = $order_type_resolver;
  $this->currentStore = $current_store;
  $this->chainPriceResolver = $chain_price_resolver;
  $this->currentUser = $current_user;
}