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-signifyd
Model
CommentsHistoryUpdater.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Signifyd\Model
;
7
8
use
Magento\Framework\Phrase
;
9
use
Magento\Sales\Api\OrderStatusHistoryRepositoryInterface
;
10
use Magento\Sales\Model\Order\Status\HistoryFactory;
11
use
Magento\Signifyd\Api\Data\CaseInterface
;
12
16
class
CommentsHistoryUpdater
17
{
21
private
$historyFactory;
22
26
private
$historyRepository;
27
34
public
function
__construct
(
35
HistoryFactory $historyFactory,
36
OrderStatusHistoryRepositoryInterface
$historyRepository
37
) {
38
$this->historyFactory = $historyFactory;
39
$this->historyRepository =
$historyRepository
;
40
}
41
51
public
function
addComment(
CaseInterface
$case
,
Phrase
$message
,
$status
=
''
)
52
{
53
if
(!
$message
->getText()) {
54
return
;
55
}
56
58
$history = $this->historyFactory->create();
59
$history->setParentId(
$case
->getOrderId())
60
->setComment(
$message
)
61
->setEntityName(
'order'
)
62
->setStatus(
$status
);
63
$this->historyRepository->save($history);
64
}
65
}
$case
$case
Definition:
approved_case.php:24
$message
$message
Definition:
notifications.php:7
Magento\Signifyd\Model
Definition:
CaseManagementTest.php:6
Magento\Signifyd\Api\Data\CaseInterface
Definition:
CaseInterface.php:17
Magento\Signifyd\Model\CommentsHistoryUpdater
Definition:
CommentsHistoryUpdater.php:16
$historyRepository
$historyRepository
Definition:
order_status_history_for_search.php:43
$status
$status
Definition:
order_status.php:8
Magento\Framework\Phrase
Definition:
Phrase.php:17
Magento\Framework\Phrase
Magento\Sales\Api\OrderStatusHistoryRepositoryInterface
Definition:
OrderStatusHistoryRepositoryInterface.php:18
Magento\Signifyd\Model\CommentsHistoryUpdater\__construct
__construct(HistoryFactory $historyFactory, OrderStatusHistoryRepositoryInterface $historyRepository)
Definition:
CommentsHistoryUpdater.php:34