1 | <?php |
||
38 | class MediaGalleryValueObserver extends AbstractProductImportObserver |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * The product media processor instance. |
||
43 | * |
||
44 | * @var \TechDivision\Import\Product\Media\Services\ProductMediaProcessorInterface |
||
45 | */ |
||
46 | protected $productMediaProcessor; |
||
47 | |||
48 | /** |
||
49 | * Initialize the observer with the passed product media processor instance. |
||
50 | * |
||
51 | * @param \TechDivision\Import\Product\Media\Services\ProductMediaProcessorInterface $productMediaProcessor The product media processor instance |
||
52 | */ |
||
53 | public function __construct(ProductMediaProcessorInterface $productMediaProcessor) |
||
57 | |||
58 | /** |
||
59 | * Return's the product media processor instance. |
||
60 | * |
||
61 | * @return \TechDivision\Import\Product\Media\Services\ProductMediaProcessorInterface The product media processor instance |
||
62 | */ |
||
63 | protected function getProductMediaProcessor() |
||
67 | |||
68 | /** |
||
69 | * Process the observer's business logic. |
||
70 | * |
||
71 | * @return array The processed row |
||
72 | */ |
||
73 | protected function process() |
||
88 | |||
89 | /** |
||
90 | * Prepare the product media gallery value that has to be persisted. |
||
91 | * |
||
92 | * @return array The prepared product media gallery value attributes |
||
93 | */ |
||
94 | protected function prepareAttributes() |
||
126 | |||
127 | /** |
||
128 | * Initialize the product media gallery value with the passed attributes and returns an instance. |
||
129 | * |
||
130 | * @param array $attr The product media gallery value attributes |
||
131 | * |
||
132 | * @return array The initialized product media gallery value |
||
133 | */ |
||
134 | protected function initializeProductMediaGalleryValue(array $attr) |
||
138 | |||
139 | /** |
||
140 | * Return's the store ID of the actual row, or of the default store |
||
141 | * if no store view code is set in the CSV file. |
||
142 | * |
||
143 | * @param string|null $default The default store view code to use, if no store view code is set in the CSV file |
||
144 | * |
||
145 | * @return integer The ID of the actual store |
||
146 | * @throws \Exception Is thrown, if the store with the actual code is not available |
||
147 | */ |
||
148 | protected function getRowStoreId($default = null) |
||
152 | |||
153 | /** |
||
154 | * Map's the passed SKU of the parent product to it's PK. |
||
155 | * |
||
156 | * @param string $parentSku The SKU of the parent product |
||
157 | * |
||
158 | * @return integer The primary key used to create relations |
||
159 | */ |
||
160 | protected function mapParentSku($parentSku) |
||
164 | |||
165 | /** |
||
166 | * Return the entity ID for the passed SKU. |
||
167 | * |
||
168 | * @param string $sku The SKU to return the entity ID for |
||
169 | * |
||
170 | * @return integer The mapped entity ID |
||
171 | * @throws \Exception Is thrown if the SKU is not mapped yet |
||
172 | */ |
||
173 | protected function mapSkuToEntityId($sku) |
||
177 | |||
178 | /** |
||
179 | * Set's the name of the created image. |
||
180 | * |
||
181 | * @param string $parentImage The name of the created image |
||
182 | * |
||
183 | * @return void |
||
184 | */ |
||
185 | protected function setParentImage($parentImage) |
||
189 | |||
190 | /** |
||
191 | * Return's the name of the created image. |
||
192 | * |
||
193 | * @return string The name of the created image |
||
194 | */ |
||
195 | protected function getParentImage() |
||
199 | |||
200 | /** |
||
201 | * Return's TRUE if the passed image is the parent one. |
||
202 | * |
||
203 | * @param string $image The imageD to check |
||
204 | * |
||
205 | * @return boolean TRUE if the passed image is the parent one |
||
206 | */ |
||
207 | protected function isParentImage($image) |
||
211 | |||
212 | /** |
||
213 | * Return's the value ID of the created media gallery entry. |
||
214 | * |
||
215 | * @return integer The ID of the created media gallery entry |
||
216 | */ |
||
217 | protected function getParentValueId() |
||
221 | |||
222 | /** |
||
223 | * Return's the store for the passed store code. |
||
224 | * |
||
225 | * @param string $storeCode The store code to return the store for |
||
226 | * |
||
227 | * @return array The requested store |
||
228 | * @throws \Exception Is thrown, if the requested store is not available |
||
229 | */ |
||
230 | protected function getStoreByStoreCode($storeCode) |
||
234 | |||
235 | /** |
||
236 | * Returns the acutal value of the position counter and raise's it by one. |
||
237 | * |
||
238 | * @return integer The actual value of the position counter |
||
239 | */ |
||
240 | protected function raisePositionCounter() |
||
244 | |||
245 | /** |
||
246 | * Persist's the passed product media gallery value data. |
||
247 | * |
||
248 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
249 | * |
||
250 | * @return void |
||
251 | */ |
||
252 | protected function persistProductMediaGalleryValue($productMediaGalleryValue) |
||
256 | } |
||
257 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: