1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* MIT License |
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
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\ReferenceEntity\ReferenceEntityApiAdapter; |
28
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Sdk\AkeneoPimSdkFactory; |
29
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Sdk\AkeneoPimSdkFactoryInterface; |
30
|
|
|
use SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface; |
31
|
|
|
|
32
|
|
|
class AdapterFactory implements AdapterFactoryInterface |
33
|
|
|
{ |
34
|
|
|
/** |
35
|
|
|
* @var \SprykerEco\Service\AkeneoPim\AkeneoPimConfig |
36
|
|
|
*/ |
37
|
|
|
protected $config; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface |
41
|
|
|
*/ |
42
|
|
|
protected $wrapperFactory; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @param \SprykerEco\Service\AkeneoPim\AkeneoPimConfig $config |
46
|
|
|
* @param \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Wrapper\WrapperFactoryInterface $wrapperFactory |
47
|
|
|
*/ |
48
|
|
|
public function __construct(AkeneoPimConfig $config, WrapperFactoryInterface $wrapperFactory) |
49
|
|
|
{ |
50
|
|
|
$this->config = $config; |
51
|
|
|
$this->wrapperFactory = $wrapperFactory; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
56
|
|
|
*/ |
57
|
|
|
public function createProductApiAdapter(): ApiAdapterInterface |
58
|
|
|
{ |
59
|
|
|
return new ProductApiAdapter( |
60
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
61
|
|
|
$this->wrapperFactory |
62
|
|
|
); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
67
|
|
|
*/ |
68
|
|
|
public function createCategoryApiAdapter(): ApiAdapterInterface |
69
|
|
|
{ |
70
|
|
|
return new CategoryApiAdapter( |
71
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
72
|
|
|
$this->wrapperFactory |
73
|
|
|
); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
78
|
|
|
*/ |
79
|
|
|
public function createAttributeApiAdapter(): ApiAdapterInterface |
80
|
|
|
{ |
81
|
|
|
return new AttributeApiAdapter( |
82
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
83
|
|
|
$this->wrapperFactory |
84
|
|
|
); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
89
|
|
|
*/ |
90
|
|
|
public function createAttributeGroupApiAdapter(): ApiAdapterInterface |
91
|
|
|
{ |
92
|
|
|
return new AttributeGroupApiAdapter( |
93
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
94
|
|
|
$this->wrapperFactory |
95
|
|
|
); |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Attributes\AttributeOptionApiAdapterInterface |
100
|
|
|
*/ |
101
|
|
|
public function createAttributeOptionApiAdapter(): AttributeOptionApiAdapterInterface |
102
|
|
|
{ |
103
|
|
|
return new AttributeOptionApiAdapter( |
104
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
105
|
|
|
$this->wrapperFactory |
106
|
|
|
); |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
111
|
|
|
*/ |
112
|
|
|
public function createAssociationTypeApiAdapter(): ApiAdapterInterface |
113
|
|
|
{ |
114
|
|
|
return new AssociationTypeApiAdapter( |
115
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
116
|
|
|
$this->wrapperFactory |
117
|
|
|
); |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
122
|
|
|
*/ |
123
|
|
|
public function createChannelApiAdapter(): ApiAdapterInterface |
124
|
|
|
{ |
125
|
|
|
return new ChannelApiAdapter( |
126
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
127
|
|
|
$this->wrapperFactory |
128
|
|
|
); |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
133
|
|
|
*/ |
134
|
|
|
public function createCurrencyApiAdapter(): ApiAdapterInterface |
135
|
|
|
{ |
136
|
|
|
return new CurrencyApiAdapter( |
137
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
138
|
|
|
$this->wrapperFactory |
139
|
|
|
); |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
144
|
|
|
*/ |
145
|
|
|
public function createFamilyApiAdapter(): ApiAdapterInterface |
146
|
|
|
{ |
147
|
|
|
return new FamilyApiAdapter( |
148
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
149
|
|
|
$this->wrapperFactory |
150
|
|
|
); |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Family\FamilyVariantApiAdapterInterface |
155
|
|
|
*/ |
156
|
|
|
public function createFamilyVariantApiAdapter(): FamilyVariantApiAdapterInterface |
157
|
|
|
{ |
158
|
|
|
return new FamilyVariantApiAdapter( |
159
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
160
|
|
|
$this->wrapperFactory |
161
|
|
|
); |
162
|
|
|
} |
163
|
|
|
|
164
|
|
|
/** |
165
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
166
|
|
|
*/ |
167
|
|
|
public function createLocaleApiAdapter(): ApiAdapterInterface |
168
|
|
|
{ |
169
|
|
|
return new LocaleApiAdapter( |
170
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
171
|
|
|
$this->wrapperFactory |
172
|
|
|
); |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
177
|
|
|
*/ |
178
|
|
|
public function createMeasureFamilyApiAdapter(): ApiAdapterInterface |
179
|
|
|
{ |
180
|
|
|
return new MeasureFamilyApiAdapter( |
181
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
182
|
|
|
$this->wrapperFactory |
183
|
|
|
); |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
188
|
|
|
*/ |
189
|
|
|
public function createProductMediaFileApiAdapter(): ApiAdapterInterface |
190
|
|
|
{ |
191
|
|
|
return new ProductMediaFileApiAdapter( |
192
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
193
|
|
|
$this->wrapperFactory |
194
|
|
|
); |
195
|
|
|
} |
196
|
|
|
|
197
|
|
|
/** |
198
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
199
|
|
|
*/ |
200
|
|
|
public function createProductModelApiAdapter(): ApiAdapterInterface |
201
|
|
|
{ |
202
|
|
|
return new ProductModelApiAdapter( |
203
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
204
|
|
|
$this->wrapperFactory |
205
|
|
|
); |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ApiAdapterInterface |
210
|
|
|
*/ |
211
|
|
|
public function createReferenceEntityApiAdapter(): ApiAdapterInterface |
212
|
|
|
{ |
213
|
|
|
return new ReferenceEntityApiAdapter( |
214
|
|
|
$this->createAkeneoPimSdkFactory()->createAkeneoPimClient($this->config), |
215
|
|
|
$this->wrapperFactory |
216
|
|
|
); |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* @return \SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\Sdk\AkeneoPimSdkFactoryInterface |
221
|
|
|
*/ |
222
|
|
|
public function createAkeneoPimSdkFactory(): AkeneoPimSdkFactoryInterface |
223
|
|
|
{ |
224
|
|
|
return new AkeneoPimSdkFactory(); |
225
|
|
|
} |
226
|
|
|
} |
227
|
|
|
|