1
1
<?php
2
- /************************************************************************
3
- *
4
- * Copyright 2024 Adobe
5
- * All Rights Reserved.
6
- *
7
- * NOTICE: All information contained herein is, and remains
8
- * the property of Adobe and its suppliers, if any. The intellectual
9
- * and technical concepts contained herein are proprietary to Adobe
10
- * and its suppliers and are protected by all applicable intellectual
11
- * property laws, including trade secret and copyright laws.
12
- * Dissemination of this information or reproduction of this material
13
- * is strictly forbidden unless prior written permission is obtained
14
- * from Adobe.
15
- * ************************************************************************
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
16
5
*/
17
6
declare (strict_types=1 );
18
7
22
11
use Magento \Framework \App \ResourceConnection ;
23
12
use Magento \Framework \DataObject ;
24
13
use Magento \Framework \Locale \FormatInterface ;
25
- use Magento \TestFramework \Fixture \Api \ServiceFactory ;
26
14
use Magento \TestFramework \Fixture \RevertibleDataFixtureInterface ;
27
15
28
16
/**
@@ -36,9 +24,9 @@ class CurrencyRate implements RevertibleDataFixtureInterface
36
24
private $ format ;
37
25
38
26
/**
39
- * @var ServiceFactory
27
+ * @var Currency
40
28
*/
41
- private $ serviceFactory ;
29
+ private $ currency ;
42
30
43
31
/**
44
32
* @var ResourceConnection
@@ -47,11 +35,11 @@ class CurrencyRate implements RevertibleDataFixtureInterface
47
35
48
36
public function __construct (
49
37
FormatInterface $ format ,
50
- ServiceFactory $ serviceFactory ,
38
+ Currency $ currency ,
51
39
ResourceConnection $ resourceConnection
52
40
) {
53
41
$ this ->format = $ format ;
54
- $ this ->serviceFactory = $ serviceFactory ;
42
+ $ this ->currency = $ currency ;
55
43
$ this ->resourceConnection = $ resourceConnection ;
56
44
}
57
45
@@ -64,9 +52,7 @@ public function apply(array $data = []): ?DataObject
64
52
$ data [$ currencyCode ][$ currencyTo ] = $ value ;
65
53
}
66
54
}
67
- $ service = $ this ->serviceFactory ->create (Currency::class, 'saveRates ' );
68
-
69
- return $ service ->execute (['rates ' => $ data ]);
55
+ $ this ->currency ->saveRates ($ data );
70
56
}
71
57
}
72
58
0 commit comments