Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-gift-message
Model
GuestCartRepository.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\GiftMessage\Model
;
9
10
use
Magento\GiftMessage\Api\Data\MessageInterface
;
11
use
Magento\GiftMessage\Api\GuestCartRepositoryInterface
;
12
use
Magento\Quote\Model\QuoteIdMask
;
13
use Magento\Quote\Model\QuoteIdMaskFactory;
14
18
class
GuestCartRepository
implements
GuestCartRepositoryInterface
19
{
23
protected
$repository
;
24
28
protected
$quoteIdMaskFactory
;
29
34
public
function
__construct
(
35
CartRepository
$repository
,
36
QuoteIdMaskFactory
$quoteIdMaskFactory
37
) {
38
$this->repository =
$repository
;
39
$this->quoteIdMaskFactory =
$quoteIdMaskFactory
;
40
}
41
45
public
function
get
(
$cartId
)
46
{
48
$quoteIdMask
= $this->quoteIdMaskFactory->create()->load(
$cartId
,
'masked_id'
);
49
return
$this->repository->get(
$quoteIdMask
->getQuoteId());
50
}
51
55
public
function
save
(
$cartId
, MessageInterface
$giftMessage
)
56
{
58
$quoteIdMask
= $this->quoteIdMaskFactory->create()->load(
$cartId
,
'masked_id'
);
59
return
$this->repository->save(
$quoteIdMask
->getQuoteId(),
$giftMessage
);
60
}
61
}
Magento\GiftMessage\Api\GuestCartRepositoryInterface\save
save($cartId, \Magento\GiftMessage\Api\Data\MessageInterface $giftMessage)
$quoteIdMask
$quoteIdMask
Definition:
quote_with_bundle_and_options_rollback.php:22
$giftMessage
$giftMessage
Definition:
items.phtml:47
Magento\GiftMessage\Model\GuestCartRepository
Definition:
GuestCartRepository.php:18
Magento\GiftMessage\Model\GuestCartRepository\__construct
__construct(CartRepository $repository, QuoteIdMaskFactory $quoteIdMaskFactory)
Definition:
GuestCartRepository.php:34
$cartId
$cartId
Definition:
quote.php:22
Magento\GiftMessage\Model
Definition:
OrderItemRepositoryTest.php:7
Magento\GiftMessage\Model\GuestCartRepository\$repository
$repository
Definition:
GuestCartRepository.php:23
Magento\GiftMessage\Api\GuestCartRepositoryInterface
Definition:
GuestCartRepositoryInterface.php:13
Magento\GiftMessage\Model\CartRepository
Definition:
CartRepository.php:17
Magento\Quote\Model\QuoteIdMask
Definition:
QuoteIdMask.php:15
Magento\GiftMessage\Model\GuestCartRepository\$quoteIdMaskFactory
$quoteIdMaskFactory
Definition:
GuestCartRepository.php:28
Magento\GiftMessage\Api\Data\MessageInterface
Definition:
MessageInterface.php:13