1 | <?php |
||
36 | class MediaSubject extends AbstractProductSubject |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The ID of the parent product to relate the variant with. |
||
41 | * |
||
42 | * @var integer |
||
43 | */ |
||
44 | protected $parentId; |
||
45 | |||
46 | /** |
||
47 | * The value ID of the created media gallery entry. |
||
48 | * |
||
49 | * @var integer |
||
50 | */ |
||
51 | protected $parentValueId; |
||
52 | |||
53 | /** |
||
54 | * The name of the craeted image. |
||
55 | * |
||
56 | * @var integer |
||
57 | */ |
||
58 | protected $parentImage; |
||
59 | |||
60 | /** |
||
61 | * The Magento installation directory. |
||
62 | * |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $installationDir; |
||
66 | |||
67 | /** |
||
68 | * The directory with the Magento media files => target directory for images (relative to the root directory). |
||
69 | * |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $mediaDir; |
||
73 | |||
74 | /** |
||
75 | * The directory with the images that have to be imported (relative to the root directory). |
||
76 | * |
||
77 | * @var string |
||
78 | */ |
||
79 | protected $imagesFileDir; |
||
80 | |||
81 | /** |
||
82 | * The position counter, if no position for the product media gallery value has been specified. |
||
83 | * |
||
84 | * @var integer |
||
85 | */ |
||
86 | protected $positionCounter = 1; |
||
87 | |||
88 | /** |
||
89 | * The available stores. |
||
90 | * |
||
91 | * @var array |
||
92 | */ |
||
93 | protected $stores = array(); |
||
94 | |||
95 | /** |
||
96 | * The mapping for the SKUs to the created entity IDs. |
||
97 | * |
||
98 | * @var array |
||
99 | */ |
||
100 | protected $skuEntityIdMapping = array(); |
||
101 | |||
102 | /** |
||
103 | * Intializes the previously loaded global data for exactly one variants. |
||
104 | * |
||
105 | * @return void |
||
106 | * @see \Importer\Csv\Actions\ProductImportAction::prepare() |
||
107 | */ |
||
108 | public function setUp() |
||
133 | |||
134 | /** |
||
135 | * Set's the Magento installation directory. |
||
136 | * |
||
137 | * @param string $installationDir The Magento installation directory |
||
138 | * |
||
139 | * @return void |
||
140 | */ |
||
141 | public function setInstallationDir($installationDir) |
||
145 | |||
146 | /** |
||
147 | * Return's the Magento installation directory. |
||
148 | * |
||
149 | * @return string The Magento installation directory |
||
150 | */ |
||
151 | public function getInstallationDir() |
||
155 | |||
156 | /** |
||
157 | * Set's directory with the Magento media files => target directory for images. |
||
158 | * |
||
159 | * @param string $mediaDir The directory with the Magento media files => target directory for images |
||
160 | * |
||
161 | * @return void |
||
162 | */ |
||
163 | public function setMediaDir($mediaDir) |
||
167 | |||
168 | /** |
||
169 | * Return's the directory with the Magento media files => target directory for images. |
||
170 | * |
||
171 | * @return string The directory with the Magento media files => target directory for images |
||
172 | */ |
||
173 | public function getMediaDir() |
||
177 | |||
178 | /** |
||
179 | * Set's directory with the images that have to be imported. |
||
180 | * |
||
181 | * @param string $imagesFileDir The directory with the images that have to be imported |
||
182 | * |
||
183 | * @return void |
||
184 | */ |
||
185 | public function setImagesFileDir($imagesFileDir) |
||
189 | |||
190 | /** |
||
191 | * Return's the directory with the images that have to be imported. |
||
192 | * |
||
193 | * @return string The directory with the images that have to be imported |
||
194 | */ |
||
195 | public function getImagesFileDir() |
||
199 | |||
200 | /** |
||
201 | * Set's the flag to copy the images or not. |
||
202 | * |
||
203 | * @param boolean $copyImages The flag |
||
204 | * |
||
205 | * @return void |
||
206 | */ |
||
207 | public function setCopyImages($copyImages) |
||
211 | |||
212 | /** |
||
213 | * Return's the flag to copy images or not. |
||
214 | * |
||
215 | * @return boolean The flag |
||
216 | */ |
||
217 | public function hasCopyImages() |
||
221 | |||
222 | /** |
||
223 | * Set's the ID of the parent product to relate the variant with. |
||
224 | * |
||
225 | * @param integer $parentId The ID of the parent product |
||
226 | * |
||
227 | * @return void |
||
228 | */ |
||
229 | public function setParentId($parentId) |
||
233 | |||
234 | /** |
||
235 | * Return's the ID of the parent product to relate the variant with. |
||
236 | * |
||
237 | * @return integer The ID of the parent product |
||
238 | */ |
||
239 | public function getParentId() |
||
243 | |||
244 | /** |
||
245 | * Set's the value ID of the created media gallery entry. |
||
246 | * |
||
247 | * @param integer $parentValueId The ID of the created media gallery entry |
||
248 | * |
||
249 | * @return void |
||
250 | */ |
||
251 | public function setParentValueId($parentValueId) |
||
255 | |||
256 | /** |
||
257 | * Return's the value ID of the created media gallery entry. |
||
258 | * |
||
259 | * @return integer The ID of the created media gallery entry |
||
260 | */ |
||
261 | public function getParentValueId() |
||
265 | |||
266 | /** |
||
267 | * Set's the name of the created image. |
||
268 | * |
||
269 | * @param string $parentImage The name of the created image |
||
270 | * |
||
271 | * @return void |
||
272 | */ |
||
273 | public function setParentImage($parentImage) |
||
277 | |||
278 | /** |
||
279 | * Return's the name of the created image. |
||
280 | * |
||
281 | * @return string The name of the created image |
||
282 | */ |
||
283 | public function getParentImage() |
||
287 | |||
288 | /** |
||
289 | * Reset the position counter to 1. |
||
290 | * |
||
291 | * @return void |
||
292 | */ |
||
293 | public function resetPositionCounter() |
||
297 | |||
298 | /** |
||
299 | * Returns the acutal value of the position counter and raise's it by one. |
||
300 | * |
||
301 | * @return integer The actual value of the position counter |
||
302 | */ |
||
303 | public function raisePositionCounter() |
||
307 | |||
308 | /** |
||
309 | * Return the entity ID for the passed SKU. |
||
310 | * |
||
311 | * @param string $sku The SKU to return the entity ID for |
||
312 | * |
||
313 | * @return integer The mapped entity ID |
||
314 | * @throws \Exception Is thrown if the SKU is not mapped yet |
||
315 | */ |
||
316 | public function mapSkuToEntityId($sku) |
||
327 | |||
328 | /** |
||
329 | * Return's the store for the passed store code. |
||
330 | * |
||
331 | * @param string $storeCode The store code to return the store for |
||
332 | * |
||
333 | * @return array The requested store |
||
334 | * @throws \Exception Is thrown, if the requested store is not available |
||
335 | */ |
||
336 | public function getStoreByStoreCode($storeCode) |
||
347 | |||
348 | /** |
||
349 | * Upload's the file with the passed name to the Magento |
||
350 | * media directory. If the file already exists, the will |
||
351 | * be given a new name that will be returned. |
||
352 | * |
||
353 | * @param string $filename The name of the file to be uploaded |
||
354 | * |
||
355 | * @return string The name of the uploaded file |
||
356 | */ |
||
357 | public function uploadFile($filename) |
||
383 | |||
384 | /** |
||
385 | * Get new file name if the same is already exists. |
||
386 | * |
||
387 | * @param string $targetFilename The name of the exisising files |
||
388 | * |
||
389 | * @return string The new filename |
||
390 | */ |
||
391 | public function getNewFileName($targetFilename) |
||
420 | |||
421 | /** |
||
422 | * Load's the product media gallery with the passed attribute ID + value. |
||
423 | * |
||
424 | * @param integer $attributeId The attribute ID of the product media gallery to load |
||
425 | * @param string $value The value of the product media gallery to load |
||
426 | * |
||
427 | * @return array The product media gallery |
||
428 | */ |
||
429 | public function loadProductMediaGallery($attributeId, $value) |
||
433 | |||
434 | /** |
||
435 | * Load's the product media gallery with the passed value/entity ID. |
||
436 | * |
||
437 | * @param integer $valueId The value ID of the product media gallery value to entity to load |
||
438 | * @param integer $entityId The entity ID of the product media gallery value to entity to load |
||
439 | * |
||
440 | * @return array The product media gallery |
||
441 | */ |
||
442 | public function loadProductMediaGalleryValueToEntity($valueId, $entityId) |
||
446 | |||
447 | /** |
||
448 | * Load's the product media gallery value with the passed value/store/parent ID. |
||
449 | * |
||
450 | * @param integer $valueId The value ID of the product media gallery value to load |
||
451 | * @param string $storeId The store ID of the product media gallery value to load |
||
452 | * @param string $entityId The entity ID of the parent product of the product media gallery value to load |
||
453 | * |
||
454 | * @return array The product media gallery value |
||
455 | */ |
||
456 | public function loadProductMediaGalleryValue($valueId, $storeId, $entityId) |
||
460 | |||
461 | /** |
||
462 | * Persist's the passed product media gallery data and return's the ID. |
||
463 | * |
||
464 | * @param array $productMediaGallery The product media gallery data to persist |
||
465 | * |
||
466 | * @return string The ID of the persisted entity |
||
467 | */ |
||
468 | public function persistProductMediaGallery($productMediaGallery) |
||
472 | |||
473 | /** |
||
474 | * Persist's the passed product media gallery value data. |
||
475 | * |
||
476 | * @param array $productMediaGalleryValue The product media gallery value data to persist |
||
477 | * |
||
478 | * @return void |
||
479 | */ |
||
480 | public function persistProductMediaGalleryValue($productMediaGalleryValue) |
||
484 | |||
485 | /** |
||
486 | * Persist's the passed product media gallery value to entity data. |
||
487 | * |
||
488 | * @param array $productMediaGalleryValuetoEntity The product media gallery value to entity data to persist |
||
489 | * |
||
490 | * @return void |
||
491 | */ |
||
492 | public function persistProductMediaGalleryValueToEntity($productMediaGalleryValuetoEntity) |
||
496 | |||
497 | /** |
||
498 | * Persist's the passed product media gallery value video data. |
||
499 | * |
||
500 | * @param array $productMediaGalleryValueVideo The product media gallery value video data to persist |
||
501 | * |
||
502 | * @return void |
||
503 | */ |
||
504 | public function persistProductMediaGalleryValueVideo($productMediaGalleryValueVideo) |
||
508 | } |
||
509 |
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: