4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
- // @codingStandardsIgnoreFile
8
-
9
7
namespace Magento \Quote \Model \GuestCart ;
10
8
11
9
use Magento \Quote \Api \GuestShippingMethodManagementInterface ;
12
- use Magento \Quote \Model \ Cart \ ShippingMethodConverter ;
10
+ use Magento \Quote \Api \ ShippingMethodManagementInterface ;
13
11
use Magento \Quote \Model \QuoteIdMask ;
14
12
use Magento \Quote \Model \QuoteIdMaskFactory ;
15
- use Magento \Quote \Model \QuoteRepository ;
16
- use Magento \Quote \Model \ShippingMethodManagement ;
17
13
18
14
/**
19
15
* Shipping method management class for guest carts.
20
16
*/
21
- class GuestShippingMethodManagement extends ShippingMethodManagement implements GuestShippingMethodManagementInterface
17
+ class GuestShippingMethodManagement implements GuestShippingMethodManagementInterface
22
18
{
19
+ /**
20
+ * @var ShippingMethodManagementInterface
21
+ */
22
+ private $ shippingMethodManagement ;
23
+
23
24
/**
24
25
* @var QuoteIdMaskFactory
25
26
*/
26
- protected $ quoteIdMaskFactory ;
27
+ private $ quoteIdMaskFactory ;
27
28
28
29
/**
29
30
* Constructs a shipping method read service object.
30
31
*
31
- * @param QuoteRepository $quoteRepository Quote repository.
32
- * @param \Magento\Quote\Api\Data\ShippingMethodInterfaceFactory $methodDataFactory Shipping method factory.
33
- * @param ShippingMethodConverter $converter Shipping method converter.
32
+ * @param ShippingMethodManagementInterface $shippingMethodManagement
34
33
* @param QuoteIdMaskFactory $quoteIdMaskFactory
35
34
*/
36
35
public function __construct (
37
- QuoteRepository $ quoteRepository ,
38
- \Magento \Quote \Api \Data \ShippingMethodInterfaceFactory $ methodDataFactory ,
39
- ShippingMethodConverter $ converter ,
36
+ ShippingMethodManagementInterface $ shippingMethodManagement ,
40
37
QuoteIdMaskFactory $ quoteIdMaskFactory
41
38
) {
42
- $ this ->quoteRepository = $ quoteRepository ;
43
- $ this ->methodDataFactory = $ methodDataFactory ;
44
- $ this ->converter = $ converter ;
39
+ $ this ->shippingMethodManagement = $ shippingMethodManagement ;
45
40
$ this ->quoteIdMaskFactory = $ quoteIdMaskFactory ;
46
41
}
47
42
@@ -52,7 +47,7 @@ public function get($cartId)
52
47
{
53
48
/** @var $quoteIdMask QuoteIdMask */
54
49
$ quoteIdMask = $ this ->quoteIdMaskFactory ->create ()->load ($ cartId , 'masked_id ' );
55
- return parent :: get ($ quoteIdMask ->getId ());
50
+ return $ this -> shippingMethodManagement -> get ($ quoteIdMask ->getId ());
56
51
}
57
52
58
53
/**
@@ -62,7 +57,7 @@ public function getList($cartId)
62
57
{
63
58
/** @var $quoteIdMask QuoteIdMask */
64
59
$ quoteIdMask = $ this ->quoteIdMaskFactory ->create ()->load ($ cartId , 'masked_id ' );
65
- return parent :: getList ($ quoteIdMask ->getId ());
60
+ return $ this -> shippingMethodManagement -> getList ($ quoteIdMask ->getId ());
66
61
}
67
62
68
63
/**
@@ -72,6 +67,6 @@ public function set($cartId, $carrierCode, $methodCode)
72
67
{
73
68
/** @var $quoteIdMask QuoteIdMask */
74
69
$ quoteIdMask = $ this ->quoteIdMaskFactory ->create ()->load ($ cartId , 'masked_id ' );
75
- return parent :: set ($ quoteIdMask ->getId (), $ carrierCode , $ methodCode );
70
+ return $ this -> shippingMethodManagement -> set ($ quoteIdMask ->getId (), $ carrierCode , $ methodCode );
76
71
}
77
72
}
0 commit comments