Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
GuestShippingAddressManagement.php
Go to the documentation of this file.
1 <?php
7 
10 use Magento\Quote\Model\QuoteIdMaskFactory;
12 
17 {
22 
27 
34  public function __construct(
36  QuoteIdMaskFactory $quoteIdMaskFactory
37  ) {
38  $this->shippingAddressManagement = $shippingAddressManagement;
39  $this->quoteIdMaskFactory = $quoteIdMaskFactory;
40  }
41 
45  public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address)
46  {
48  $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
49  return $this->shippingAddressManagement->assign($quoteIdMask->getQuoteId(), $address);
50  }
51 
55  public function get($cartId)
56  {
58  $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
59  return $this->shippingAddressManagement->get($quoteIdMask->getQuoteId());
60  }
61 }
__construct(ShippingAddressManagementInterface $shippingAddressManagement, QuoteIdMaskFactory $quoteIdMaskFactory)
$address
Definition: customer.php:38
assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address)
$cartId
Definition: quote.php:22