1 | <?php |
||
13 | class ProductUpdater |
||
14 | { |
||
15 | const DEFAULT_PRODUCT_CURRENCY = 'USD'; |
||
16 | |||
17 | /** |
||
18 | * @var ProductAttributeHelper |
||
19 | */ |
||
20 | private $attributeHelper; |
||
21 | |||
22 | /** |
||
23 | * @var ProductRepository |
||
24 | */ |
||
25 | private $productRepository; |
||
26 | |||
27 | /** |
||
28 | * @var PropertySetterInterface |
||
29 | */ |
||
30 | private $productPropertySetter; |
||
31 | |||
32 | /** |
||
33 | * @var ProductSaver |
||
34 | */ |
||
35 | private $productSaver; |
||
36 | |||
37 | /** |
||
38 | * @var |
||
39 | */ |
||
40 | private $updateInfo; |
||
41 | |||
42 | /** |
||
43 | * @param ProductAttributeHelper $attributeHelper |
||
44 | * @param ProductRepository $productRepository |
||
45 | * @param PropertySetterInterface $productPropertySetter |
||
46 | * @param ProductSaver $productSaver |
||
47 | */ |
||
48 | public function __construct( |
||
60 | |||
61 | /** |
||
62 | * Update product attribute value |
||
63 | * |
||
64 | * @param $productId |
||
65 | * @param $attribute |
||
66 | * @param $attributeValue |
||
67 | * @param $dataLocale |
||
68 | * @param $scopeCode |
||
69 | * @return bool |
||
70 | */ |
||
71 | public function update($productId, $attribute, $attributeValue, $dataLocale, $scopeCode) |
||
107 | |||
108 | /** |
||
109 | * @return mixed |
||
110 | */ |
||
111 | public function getUpdateInfo() |
||
115 | |||
116 | /** |
||
117 | * @param mixed $updateInfo |
||
118 | */ |
||
119 | public function setUpdateInfo($updateInfo) |
||
123 | |||
124 | /** |
||
125 | * @param $attribute |
||
126 | * @param $attributeValue |
||
127 | * @return array |
||
128 | */ |
||
129 | protected function prepareAttributeValue($attribute, $attributeValue) |
||
142 | } |
||
143 |