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\Zed\AkeneoPimMiddlewareConnector\Business\Translator\Dictionary; |
9
|
|
|
|
10
|
|
|
use SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig; |
11
|
|
|
use SprykerMiddleware\Zed\Process\Business\Translator\Dictionary\AbstractDictionary; |
|
|
|
|
12
|
|
|
|
13
|
|
|
class ProductModelImportDictionary extends AbstractDictionary |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @var array |
17
|
|
|
*/ |
18
|
|
|
protected static $localeMap; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @var array |
22
|
|
|
*/ |
23
|
|
|
protected static $attributeMap; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @var \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig |
27
|
|
|
*/ |
28
|
|
|
private $config; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @param \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig $config |
32
|
|
|
*/ |
33
|
|
|
public function __construct(AkeneoPimMiddlewareConnectorConfig $config) |
34
|
|
|
{ |
35
|
|
|
$this->config = $config; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @return array |
40
|
|
|
*/ |
41
|
|
|
public function getDictionary(): array |
42
|
|
|
{ |
43
|
|
|
return [ |
44
|
|
|
'categories' => [ |
45
|
|
|
[ |
46
|
|
|
'ArrayToString', |
47
|
|
|
'options' => [ |
48
|
|
|
'glue' => ',', |
49
|
|
|
], |
50
|
|
|
], |
51
|
|
|
], |
52
|
|
|
'values.*' => 'MeasureUnitToInt', |
53
|
|
|
'values' => [ |
54
|
|
|
[ |
55
|
|
|
'EnrichAttributes', |
56
|
|
|
'options' => [ |
57
|
|
|
'map' => $this->getAttributeMap(), |
58
|
|
|
'excludeKeys' => [ |
59
|
|
|
'country_availability', |
60
|
|
|
], |
61
|
|
|
], |
62
|
|
|
], |
63
|
|
|
[ |
64
|
|
|
'ValuesToAttributes', |
65
|
|
|
'options' => [ |
66
|
|
|
'locales' => $this->config->getLocalesForImport(), |
67
|
|
|
], |
68
|
|
|
], |
69
|
|
|
[ |
70
|
|
|
'ValuesToLocalizedAttributes', |
71
|
|
|
'options' => [ |
72
|
|
|
'locales' => $this->config->getLocalesForImport(), |
73
|
|
|
], |
74
|
|
|
], |
75
|
|
|
], |
76
|
|
|
'values.localizedAttributes' => [ |
77
|
|
|
[ |
78
|
|
|
'LocaleKeysToIds', |
79
|
|
|
'options' => [ |
80
|
|
|
'map' => $this->getLocaleMap(), |
81
|
|
|
], |
82
|
|
|
], |
83
|
|
|
[ |
84
|
|
|
'MoveLocalizedAttributesToAttributes', |
85
|
|
|
'options' => [ |
86
|
|
|
'blacklist' => [ |
87
|
|
|
'name', |
88
|
|
|
'title', |
89
|
|
|
'product_description', |
90
|
|
|
'meta_keywords', |
91
|
|
|
'meta_title', |
92
|
|
|
'meta_description', |
93
|
|
|
'tax_set', |
94
|
|
|
'is_active_per_locale', |
95
|
|
|
'bild_information', |
96
|
|
|
'picto_informationen', |
97
|
|
|
], |
98
|
|
|
], |
99
|
|
|
], |
100
|
|
|
], |
101
|
|
|
'values.localizedAttributes.*' => [ |
102
|
|
|
[ |
103
|
|
|
'AddMissingAttributes', |
104
|
|
|
'options' => [ |
105
|
|
|
'attributes' => [ |
106
|
|
|
'name' => '', |
107
|
|
|
'description' => '', |
108
|
|
|
'meta_title' => '', |
109
|
|
|
'meta_description' => '', |
110
|
|
|
'meta_keywords' => '', |
111
|
|
|
], |
112
|
|
|
], |
113
|
|
|
], |
114
|
|
|
], |
115
|
|
|
'values.attributes' => [ |
116
|
|
|
[ |
117
|
|
|
'ExcludeKeysAssociativeFilter', |
118
|
|
|
'options' => [ |
119
|
|
|
'excludeKeys' => [ |
120
|
|
|
'price', |
121
|
|
|
'country_availability', |
122
|
|
|
], |
123
|
|
|
], |
124
|
|
|
], |
125
|
|
|
], |
126
|
|
|
]; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @return array |
131
|
|
|
*/ |
132
|
|
|
protected function getLocaleMap(): array |
133
|
|
|
{ |
134
|
|
|
if (static::$localeMap === null) { |
|
|
|
|
135
|
|
|
$content = file_get_contents($this->config->getLocaleMapFilePath()); |
136
|
|
|
static::$localeMap = json_decode($content, true); |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
return static::$localeMap; |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
/** |
143
|
|
|
* @return array |
144
|
|
|
*/ |
145
|
|
|
protected function getAttributeMap(): array |
146
|
|
|
{ |
147
|
|
|
if (static::$attributeMap === null) { |
|
|
|
|
148
|
|
|
$content = file_get_contents($this->config->getAttributeMapFilePath()); |
149
|
|
|
static::$attributeMap = json_decode($content, true); |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
return static::$attributeMap; |
153
|
|
|
} |
154
|
|
|
} |
155
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths