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-quote
Model
QuoteRepository
Plugin
AccessChangeQuoteControl.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Quote\Model\QuoteRepository\Plugin
;
8
9
use
Magento\Quote\Api\ChangeQuoteControlInterface
;
10
use
Magento\Framework\Exception\StateException
;
11
use
Magento\Quote\Api\CartRepositoryInterface
;
12
use
Magento\Quote\Api\Data\CartInterface
;
13
17
class
AccessChangeQuoteControl
18
{
22
private
$changeQuoteControl;
23
27
public
function
__construct
(
ChangeQuoteControlInterface
$changeQuoteControl)
28
{
29
$this->changeQuoteControl = $changeQuoteControl;
30
}
31
42
public
function
beforeSave
(
CartRepositoryInterface
$subject,
CartInterface
$quote
)
43
{
44
if
(! $this->changeQuoteControl->isAllowed(
$quote
)) {
45
throw
new
StateException
(
__
(
"Invalid state change requested"
));
46
}
47
}
48
}
Magento\Quote\Model\QuoteRepository\Plugin
Definition:
AccessChangeQuoteControl.php:7
Magento\Quote\Api\Data\CartInterface
Definition:
CartInterface.php:13
Magento\Framework\Exception\StateException
Definition:
StateException.php:14
$quote
$quote
Definition:
paypal_quote.php:17
__
__()
Definition:
__.php:13
Magento\Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl
Definition:
AccessChangeQuoteControl.php:17
Magento\Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl\beforeSave
beforeSave(CartRepositoryInterface $subject, CartInterface $quote)
Definition:
AccessChangeQuoteControl.php:42
Magento\Quote\Model\QuoteRepository\Plugin\AccessChangeQuoteControl\__construct
__construct(ChangeQuoteControlInterface $changeQuoteControl)
Definition:
AccessChangeQuoteControl.php:27
Magento\Quote\Api\ChangeQuoteControlInterface
Definition:
ChangeQuoteControlInterface.php:16
Magento\Quote\Api\CartRepositoryInterface
Definition:
CartRepositoryInterface.php:13