99
1010use Magento \Framework \App \ResourceConnection ;
1111use Magento \Sales \Model \Order ;
12- use Magento \Sales \Model \OrderRepository ;
1312
1413/**
1514 * Sales order status change history resource model.
@@ -28,11 +27,9 @@ class SalesOrderStatusChangeHistory
2827
2928 /**
3029 * @param ResourceConnection $resourceConnection
31- * @param OrderRepository $orderRepository
3230 */
3331 public function __construct (
3432 private readonly ResourceConnection $ resourceConnection ,
35- private readonly OrderRepository $ orderRepository ,
3633 ) {
3734 }
3835
@@ -47,7 +44,7 @@ public function getLatestStatus(int $orderId): ?array
4744 $ connection = $ this ->resourceConnection ->getConnection ();
4845 return $ connection ->fetchRow (
4946 $ connection ->select ()->from (
50- $ connection ->getTableName (self ::TABLE_NAME ),
47+ $ this -> resourceConnection ->getTableName (self ::TABLE_NAME ),
5148 ['status ' , 'created_at ' ]
5249 )->where (
5350 'order_id = ? ' ,
@@ -70,7 +67,7 @@ public function insert(Order $order): void
7067
7168 $ connection = $ this ->resourceConnection ->getConnection ();
7269 $ connection ->insert (
73- $ connection ->getTableName (self ::TABLE_NAME ),
70+ $ this -> resourceConnection ->getTableName (self ::TABLE_NAME ),
7471 [
7572 'order_id ' => (int )$ order ->getId (),
7673 'status ' => $ order ->getStatus ()
@@ -89,7 +86,7 @@ private function isOrderExists(int $orderId): bool
8986 $ connection = $ this ->resourceConnection ->getConnection ();
9087 $ entityId = $ connection ->fetchOne (
9188 $ connection ->select ()->from (
92- $ connection ->getTableName (self ::ORDER_TABLE_NAME ),
89+ $ this -> resourceConnection ->getTableName (self ::ORDER_TABLE_NAME ),
9390 ['entity_id ' ]
9491 )->where (
9592 'entity_id = ? ' ,
0 commit comments