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\Mapper\Map; |
9
|
|
|
|
10
|
|
|
use SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig; |
11
|
|
|
use SprykerMiddleware\Zed\Process\Business\Mapper\Map\AbstractMap; |
|
|
|
|
12
|
|
|
use SprykerMiddleware\Zed\Process\Business\Mapper\Map\MapInterface; |
|
|
|
|
13
|
|
|
|
14
|
|
|
class ProductImportMap extends AbstractMap |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @var \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig |
18
|
|
|
*/ |
19
|
|
|
protected $config; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @param \SprykerEco\Zed\AkeneoPimMiddlewareConnector\AkeneoPimMiddlewareConnectorConfig $config |
23
|
|
|
*/ |
24
|
|
|
public function __construct(AkeneoPimMiddlewareConnectorConfig $config) |
25
|
|
|
{ |
26
|
|
|
$this->config = $config; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @return array |
31
|
|
|
*/ |
32
|
|
|
public function getMap(): array |
33
|
|
|
{ |
34
|
|
|
return [ |
35
|
|
|
'taxSetName' => function ($item) { |
|
|
|
|
36
|
|
|
return $this->config->getTaxSet(); |
37
|
|
|
}, |
38
|
|
|
'color_code' => function ($item) { |
|
|
|
|
39
|
|
|
return ''; |
40
|
|
|
}, |
41
|
|
|
'new_from' => function ($item) { |
|
|
|
|
42
|
|
|
return null; |
43
|
|
|
}, |
44
|
|
|
'new_to' => function ($item) { |
|
|
|
|
45
|
|
|
return null; |
46
|
|
|
}, |
47
|
|
|
'category_key' => 'categories', |
48
|
|
|
'category_product_order' => function ($item) { |
|
|
|
|
49
|
|
|
return 0; |
50
|
|
|
}, |
51
|
|
|
'stores' => function ($item) { |
|
|
|
|
52
|
|
|
return $this->config->getActiveStoresForProducts(); |
53
|
|
|
}, |
54
|
|
|
'concrete_sku' => 'identifier', |
55
|
|
|
'abstract_sku' => 'parent.abstract_sku', |
56
|
|
|
'abstract_product_creation' => 'parent.abstract_product_creation', |
57
|
|
|
'prices' => function ($item) { |
58
|
|
|
$result = []; |
59
|
|
|
foreach ($item['values']['price'] as $value) { |
60
|
|
|
$result[] = [ |
61
|
|
|
'price' => $value['price'], |
62
|
|
|
'price_type' => $value['type'], |
63
|
|
|
'currency' => $value['currency'], |
64
|
|
|
'store' => $value['store'], |
65
|
|
|
'concrete_sku' => $item['identifier'], |
66
|
|
|
'value_gross' => $value['price'], |
67
|
|
|
'value_net' => $value['price'], |
68
|
|
|
]; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
return $result; |
72
|
|
|
}, |
73
|
|
|
'images' => 'values.bild_information', |
74
|
|
|
'picto_images' => 'values.picto_informationen', |
75
|
|
|
'is_active' => 'enabled', |
76
|
|
|
'attributes' => [ |
77
|
|
|
'values.attributes', |
78
|
|
|
], |
79
|
|
|
'localizedAttributes' => [ |
80
|
|
|
'values.localizedAttributes', |
81
|
|
|
], |
82
|
|
|
'relations.others' => 'associations.PACK.product_models', |
83
|
|
|
'relations.x_sell' => 'associations.X_SELL.product_models', |
84
|
|
|
'relations.addon' => 'associations.SUBSTITUTION.product_models', |
85
|
|
|
'is_searchable' => function () { |
86
|
|
|
return true; |
87
|
|
|
}, |
88
|
|
|
]; |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @return string |
93
|
|
|
*/ |
94
|
|
|
public function getStrategy(): string |
95
|
|
|
{ |
96
|
|
|
return MapInterface::MAPPER_STRATEGY_SKIP_UNKNOWN; |
97
|
|
|
} |
98
|
|
|
} |
99
|
|
|
|
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