9
9
10
10
use Magento \Framework \App \ResourceConnection ;
11
11
use Magento \Sales \Model \Order ;
12
- use Magento \Sales \Model \OrderRepository ;
13
12
14
13
/**
15
14
* Sales order status change history resource model.
@@ -28,11 +27,9 @@ class SalesOrderStatusChangeHistory
28
27
29
28
/**
30
29
* @param ResourceConnection $resourceConnection
31
- * @param OrderRepository $orderRepository
32
30
*/
33
31
public function __construct (
34
32
private readonly ResourceConnection $ resourceConnection ,
35
- private readonly OrderRepository $ orderRepository ,
36
33
) {
37
34
}
38
35
@@ -47,7 +44,7 @@ public function getLatestStatus(int $orderId): ?array
47
44
$ connection = $ this ->resourceConnection ->getConnection ();
48
45
return $ connection ->fetchRow (
49
46
$ connection ->select ()->from (
50
- $ connection ->getTableName (self ::TABLE_NAME ),
47
+ $ this -> resourceConnection ->getTableName (self ::TABLE_NAME ),
51
48
['status ' , 'created_at ' ]
52
49
)->where (
53
50
'order_id = ? ' ,
@@ -70,7 +67,7 @@ public function insert(Order $order): void
70
67
71
68
$ connection = $ this ->resourceConnection ->getConnection ();
72
69
$ connection ->insert (
73
- $ connection ->getTableName (self ::TABLE_NAME ),
70
+ $ this -> resourceConnection ->getTableName (self ::TABLE_NAME ),
74
71
[
75
72
'order_id ' => (int )$ order ->getId (),
76
73
'status ' => $ order ->getStatus ()
@@ -89,7 +86,7 @@ private function isOrderExists(int $orderId): bool
89
86
$ connection = $ this ->resourceConnection ->getConnection ();
90
87
$ entityId = $ connection ->fetchOne (
91
88
$ connection ->select ()->from (
92
- $ connection ->getTableName (self ::ORDER_TABLE_NAME ),
89
+ $ this -> resourceConnection ->getTableName (self ::ORDER_TABLE_NAME ),
93
90
['entity_id ' ]
94
91
)->where (
95
92
'entity_id = ? ' ,
0 commit comments