1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved. |
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter; |
9
|
|
|
|
10
|
|
|
use SprykerEco\Service\AkeneoPim\AkeneoPimConfig; |
11
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Attributes\AttributeApiAdapter; |
12
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Attributes\AttributeGroupApiAdapter; |
13
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Attributes\AttributeOptionApiAdapter; |
14
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Attributes\AttributeOptionApiAdapterInterface; |
15
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Category\CategoryApiAdapter; |
16
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Category\ChannelApiAdapter; |
17
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Category\CurrencyApiAdapter; |
18
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Category\LocaleApiAdapter; |
19
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Family\FamilyApiAdapter; |
20
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Family\FamilyVariantApiAdapter; |
21
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Family\FamilyVariantApiAdapterInterface; |
22
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Family\MeasureFamilyApiAdapter; |
23
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Product\AssociationTypeApiAdapter; |
24
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Product\ProductApiAdapter; |
25
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Product\ProductMediaFileApiAdapter; |
26
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Product\ProductModelApiAdapter; |
27
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Sdk\AkeneoPimSdkFactory; |
28
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Sdk\AkeneoPimSdkFactoryInterface; |
29
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface; |
30
|
|
|
|
31
|
|
|
class AdapterFactory implements AdapterFactoryInterface |
32
|
|
|
{ |
33
|
|
|
/** |
34
|
|
|
* @var \SprykerEco\Service\AkeneoPim\AkeneoPimConfig |
35
|
|
|
*/ |
36
|
|
|
protected $config; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface |
40
|
|
|
*/ |
41
|
|
|
protected $wrapperFactory; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param \SprykerEco\Service\AkeneoPim\AkeneoPimConfig $config |
45
|
|
|
* @param \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface $wrapperFactory |
46
|
|
|
*/ |
47
|
|
|
public function __construct(AkeneoPimConfig $config, WrapperFactoryInterface $wrapperFactory) |
48
|
|
|
{ |
49
|
|
|
$this->config = $config; |
50
|
|
|
$this->wrapperFactory = $wrapperFactory; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
55
|
|
|
*/ |
56
|
|
|
public function createProductApiAdapter(): ApiAdapterInterface |
57
|
|
|
{ |
58
|
|
|
return new ProductApiAdapter( |
59
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
60
|
|
|
$this->wrapperFactory, |
61
|
|
|
); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
66
|
|
|
*/ |
67
|
|
|
public function createCategoryApiAdapter(): ApiAdapterInterface |
68
|
|
|
{ |
69
|
|
|
return new CategoryApiAdapter( |
70
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
71
|
|
|
$this->wrapperFactory, |
72
|
|
|
); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
77
|
|
|
*/ |
78
|
|
|
public function createAttributeApiAdapter(): ApiAdapterInterface |
79
|
|
|
{ |
80
|
|
|
return new AttributeApiAdapter( |
81
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
82
|
|
|
$this->wrapperFactory, |
83
|
|
|
); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
88
|
|
|
*/ |
89
|
|
|
public function createAttributeGroupApiAdapter(): ApiAdapterInterface |
90
|
|
|
{ |
91
|
|
|
return new AttributeGroupApiAdapter( |
92
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
93
|
|
|
$this->wrapperFactory, |
94
|
|
|
); |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Attributes\AttributeOptionApiAdapterInterface |
99
|
|
|
*/ |
100
|
|
|
public function createAttributeOptionApiAdapter(): AttributeOptionApiAdapterInterface |
101
|
|
|
{ |
102
|
|
|
return new AttributeOptionApiAdapter( |
103
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
104
|
|
|
$this->wrapperFactory, |
105
|
|
|
); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
110
|
|
|
*/ |
111
|
|
|
public function createAssociationTypeApiAdapter(): ApiAdapterInterface |
112
|
|
|
{ |
113
|
|
|
return new AssociationTypeApiAdapter( |
114
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
115
|
|
|
$this->wrapperFactory, |
116
|
|
|
); |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
121
|
|
|
*/ |
122
|
|
|
public function createChannelApiAdapter(): ApiAdapterInterface |
123
|
|
|
{ |
124
|
|
|
return new ChannelApiAdapter( |
125
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
126
|
|
|
$this->wrapperFactory, |
127
|
|
|
); |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
132
|
|
|
*/ |
133
|
|
|
public function createCurrencyApiAdapter(): ApiAdapterInterface |
134
|
|
|
{ |
135
|
|
|
return new CurrencyApiAdapter( |
136
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
137
|
|
|
$this->wrapperFactory, |
138
|
|
|
); |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
143
|
|
|
*/ |
144
|
|
|
public function createFamilyApiAdapter(): ApiAdapterInterface |
145
|
|
|
{ |
146
|
|
|
return new FamilyApiAdapter( |
147
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
148
|
|
|
$this->wrapperFactory, |
149
|
|
|
); |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Family\FamilyVariantApiAdapterInterface |
154
|
|
|
*/ |
155
|
|
|
public function createFamilyVariantApiAdapter(): FamilyVariantApiAdapterInterface |
156
|
|
|
{ |
157
|
|
|
return new FamilyVariantApiAdapter( |
158
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
159
|
|
|
$this->wrapperFactory, |
160
|
|
|
); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
165
|
|
|
*/ |
166
|
|
|
public function createLocaleApiAdapter(): ApiAdapterInterface |
167
|
|
|
{ |
168
|
|
|
return new LocaleApiAdapter( |
169
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
170
|
|
|
$this->wrapperFactory, |
171
|
|
|
); |
172
|
|
|
} |
173
|
|
|
|
174
|
|
|
/** |
175
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
176
|
|
|
*/ |
177
|
|
|
public function createMeasureFamilyApiAdapter(): ApiAdapterInterface |
178
|
|
|
{ |
179
|
|
|
return new MeasureFamilyApiAdapter( |
180
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
181
|
|
|
$this->wrapperFactory, |
182
|
|
|
); |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
187
|
|
|
*/ |
188
|
|
|
public function createProductMediaFileApiAdapter(): ApiAdapterInterface |
189
|
|
|
{ |
190
|
|
|
return new ProductMediaFileApiAdapter( |
191
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
192
|
|
|
$this->wrapperFactory, |
193
|
|
|
); |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
/** |
197
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
198
|
|
|
*/ |
199
|
|
|
public function createProductModelApiAdapter(): ApiAdapterInterface |
200
|
|
|
{ |
201
|
|
|
return new ProductModelApiAdapter( |
202
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
203
|
|
|
$this->wrapperFactory, |
204
|
|
|
); |
205
|
|
|
} |
206
|
|
|
|
207
|
|
|
/** |
208
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Sdk\AkeneoPimSdkFactoryInterface |
209
|
|
|
*/ |
210
|
|
|
public function createAkeneoPimSdkFactory(): AkeneoPimSdkFactoryInterface |
211
|
|
|
{ |
212
|
|
|
return new AkeneoPimSdkFactory(); |
213
|
|
|
} |
214
|
|
|
} |
215
|
|
|
|