1
1
<?php
2
2
namespace CtiDigital \Configurator \Component ;
3
3
4
- use Magento \ Framework \ ObjectManagerInterface ;
4
+ use CtiDigital \ Configurator \ Api \ ComponentInterface ;
5
5
use Magento \Integration \Model \IntegrationFactory ;
6
6
use Magento \Integration \Model \Oauth \TokenFactory ;
7
7
use CtiDigital \Configurator \Api \LoggerInterface ;
8
8
use Magento \Integration \Model \AuthorizationService ;
9
9
use Magento \Integration \Api \IntegrationServiceInterface ;
10
10
use CtiDigital \Configurator \Exception \ComponentException ;
11
11
12
- class ApiIntegrations extends YamlComponentAbstract
12
+ class ApiIntegrations implements ComponentInterface
13
13
{
14
14
protected $ alias = 'apiintegrations ' ;
15
15
protected $ name = 'Api Integrations ' ;
@@ -35,35 +35,37 @@ class ApiIntegrations extends YamlComponentAbstract
35
35
*/
36
36
protected $ tokenFactory ;
37
37
38
+ /**
39
+ * @var LoggerInterface
40
+ */
41
+ protected $ log ;
42
+
38
43
/**
39
44
* ApiIntegrations constructor.
40
- * @param LoggerInterface $log
41
- * @param ObjectManagerInterface $objectManager
42
45
* @param IntegrationFactory $integrationFactory
43
46
* @param IntegrationServiceInterface $integrationService
44
47
* @param AuthorizationService $authorizationService
45
48
* @param TokenFactory $tokenFactory
49
+ * @param LoggerInterface $log
46
50
*/
47
51
public function __construct (
48
- LoggerInterface $ log ,
49
- ObjectManagerInterface $ objectManager ,
50
52
IntegrationFactory $ integrationFactory ,
51
53
IntegrationServiceInterface $ integrationService ,
52
54
AuthorizationService $ authorizationService ,
53
- TokenFactory $ tokenFactory
55
+ TokenFactory $ tokenFactory ,
56
+ LoggerInterface $ log
54
57
) {
55
- parent ::__construct ($ log , $ objectManager );
56
-
57
58
$ this ->integrationFactory = $ integrationFactory ;
58
59
$ this ->integrationService = $ integrationService ;
59
60
$ this ->authorizationService = $ authorizationService ;
60
61
$ this ->tokenFactory = $ tokenFactory ;
62
+ $ this ->log = $ log ;
61
63
}
62
64
63
65
/**
64
66
* @param array $data
65
67
*/
66
- protected function processData ($ data = null )
68
+ public function execute ($ data = null )
67
69
{
68
70
if (isset ($ data ['apiintegrations ' ])) {
69
71
foreach ($ data ['apiintegrations ' ] as $ integrationData ) {
@@ -166,4 +168,20 @@ private function activateAndAuthorize($consumerId)
166
168
$ token ->setType ('access ' );
167
169
$ token ->save ();
168
170
}
171
+
172
+ /**
173
+ * @return string
174
+ */
175
+ public function getAlias ()
176
+ {
177
+ return $ this ->alias ;
178
+ }
179
+
180
+ /**
181
+ * @return string
182
+ */
183
+ public function getDescription ()
184
+ {
185
+ return $ this ->description ;
186
+ }
169
187
}
0 commit comments