99use Drupal \commerce_order \Resolver \OrderTypeResolverInterface ;
1010use Drupal \commerce_price \Resolver \ChainPriceResolverInterface ;
1111use Drupal \commerce_store \StoreContextInterface ;
12- use Drupal \Core \ Entity \ EntityManagerInterface ;
12+ use Drupal \Component \ Datetime \ TimeInterface ;
1313use Drupal \Core \Entity \ContentEntityForm ;
14+ use Drupal \Core \Entity \EntityManagerInterface ;
15+ use Drupal \Core \Entity \EntityTypeBundleInfoInterface ;
1416use Drupal \Core \Form \FormStateInterface ;
1517use Drupal \Core \Link ;
1618use Drupal \Core \Session \AccountInterface ;
@@ -77,6 +79,10 @@ class AddToCartForm extends ContentEntityForm {
7779 *
7880 * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
7981 * The entity manager.
82+ * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
83+ * The entity type bundle info.
84+ * @param \Drupal\Component\Datetime\TimeInterface $time
85+ * The time.
8086 * @param \Drupal\commerce_cart\CartManagerInterface $cart_manager
8187 * The cart manager.
8288 * @param \Drupal\commerce_cart\CartProviderInterface $cart_provider
@@ -90,8 +96,8 @@ class AddToCartForm extends ContentEntityForm {
9096 * @param \Drupal\Core\Session\AccountInterface $current_user
9197 * The current user.
9298 */
93- public function __construct (EntityManagerInterface $ entity_manager , CartManagerInterface $ cart_manager , CartProviderInterface $ cart_provider , OrderTypeResolverInterface $ order_type_resolver , StoreContextInterface $ store_context , ChainPriceResolverInterface $ chain_price_resolver , AccountInterface $ current_user ) {
94- parent ::__construct ($ entity_manager );
99+ public function __construct (EntityManagerInterface $ entity_manager , EntityTypeBundleInfoInterface $ entity_type_bundle_info , TimeInterface $ time , CartManagerInterface $ cart_manager , CartProviderInterface $ cart_provider , OrderTypeResolverInterface $ order_type_resolver , StoreContextInterface $ store_context , ChainPriceResolverInterface $ chain_price_resolver , AccountInterface $ current_user ) {
100+ parent ::__construct ($ entity_manager, $ entity_type_bundle_info , $ time );
95101
96102 $ this ->cartManager = $ cart_manager ;
97103 $ this ->cartProvider = $ cart_provider ;
@@ -109,6 +115,8 @@ public function __construct(EntityManagerInterface $entity_manager, CartManagerI
109115 public static function create (ContainerInterface $ container ) {
110116 return new static (
111117 $ container ->get ('entity.manager ' ),
118+ $ container ->get ('entity_type.bundle.info ' ),
119+ $ container ->get ('datetime.time ' ),
112120 $ container ->get ('commerce_cart.cart_manager ' ),
113121 $ container ->get ('commerce_cart.cart_provider ' ),
114122 $ container ->get ('commerce_order.chain_order_type_resolver ' ),
0 commit comments